bug fixes
This commit is contained in:
@@ -490,6 +490,24 @@ class EventsService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Hard-deletes an event (and any recurrence children) from the database.
|
||||
* Returns true if the event was found and deleted, false if not found.
|
||||
*/
|
||||
async deleteEvent(id: string): Promise<boolean> {
|
||||
logger.info('Hard-deleting event', { id });
|
||||
// Delete recurrence children first (wiederholung_parent_id references)
|
||||
await pool.query(
|
||||
`DELETE FROM veranstaltungen WHERE wiederholung_parent_id = $1`,
|
||||
[id]
|
||||
);
|
||||
const result = await pool.query(
|
||||
`DELETE FROM veranstaltungen WHERE id = $1`,
|
||||
[id]
|
||||
);
|
||||
return (result.rowCount ?? 0) > 0;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// ICAL TOKEN
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user