finalized event cancel logic

This commit is contained in:
2025-11-27 19:53:31 -05:00
parent 33fcb16427
commit 0ba42e6f78
6 changed files with 106 additions and 22 deletions

View File

@@ -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 };
}