but now it's working

This commit is contained in:
mmacierzanka committed 2021-10-07 21:01:09 +02:00
1 parent 44dcac4c61
commit 72ccfb5bac
1 file changed
+1 -5
+1 -5
View File
@@ -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;
}