Archived
but now it's working
This commit is contained in:
1 parent
44dcac4c61
commit
72ccfb5bac
1 file changed
+1
-5
@@ -26,11 +26,7 @@ export class APIClient extends EventEmitter {
|
||||
async deleteEvent(item) {
|
||||
const rq = await axios.post(`${this.#dbUrl}/api/deleteEvent`, item);
|
||||
if (rq.status !== 200) throw new Error(`Request failed with status code ${rq.status}: ${rq.statusText}`);
|
||||
this.#events.splice(
|
||||
this.#events.findIndex((e) => e._id === item.id),
|
||||
1
|
||||
);
|
||||
this.emit("EVENT_CREATE", this.#events, rq.data);
|
||||
await this.fetchEvents();
|
||||
return rq.data;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user