finalized event cancel logic
This commit is contained in:
@@ -52,13 +52,15 @@ export async function updateEvent(eventObject: CalendarEvent) {
|
||||
return { success: true };
|
||||
}
|
||||
|
||||
export async function cancelEvent(eventID: number) {
|
||||
export async function setEventCancelled(eventID: number, cancelled: boolean) {
|
||||
const input = cancelled ? 1 : 0;
|
||||
console.log(cancelled, input);
|
||||
const sql = `
|
||||
UPDATE calendar_events
|
||||
SET cancelled = 1
|
||||
SET cancelled = ?
|
||||
WHERE id = ?
|
||||
`;
|
||||
await pool.query(sql, [eventID]);
|
||||
await pool.query(sql, [input, eventID]);
|
||||
return { success: true };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user