I’m using node.js
When I try to update or delete a task, instead of doing it it inserts another task.
this is what I have for them:
// update event
async update(id, data) {
await this._db.query(
"UPDATE ?? SET `start_date` = ?, `end_date` = ?, `text` = ? WHERE id = ?",
[this.table, data.start_date, data.end_date, data.text, id]);
return {
action: "updated"
}
}
// delete event
async delete(id,data) {
await this._db.query(
"DELETE FROM ?? WHERE `id`=? ;",
[this.table, data.start_date, data.end_date, data.text, id]);
return {
action: "deleted"
}
}