bug fixes

This commit is contained in:
Matthias Hochmeister
2026-03-03 14:45:46 +01:00
parent 004b141cab
commit 5dfaf7db54
11 changed files with 166 additions and 35 deletions

View File

@@ -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
// -------------------------------------------------------------------------