Events: toggle switch to activate/deactivate (single-active)

- Replace the 'Set active' button / 'Active' pill in the Events table with a
  toggle switch. Activating an event deactivates all others (enforced by the
  existing DB trigger + partial unique index); deactivating just turns it off.
- Add deactivateEvent() API helper.
- Update docs (admin-app.md, next-steps.md).

Co-authored-by: Stephan Charles <[email protected]>
Co-authored-by: Amelia Hernandez <[email protected]>
Co-authored-by: Markus Franz <[email protected]>
Co-authored-by: Sabrina Hota <[email protected]>
Co-authored-by: Nilüfer Doğan <[email protected]>
This commit is contained in:
committed 2026-08-24 11:01:32 +02:00
1 parent 24909cf8ab
commit a0bcf866dc
4 files changed
+21 -20

No files matched your search

+6
View File
@@ -159,6 +159,12 @@ export async function activateEvent(id: string): Promise<void> {
if (error) throw new ApiError(error.message);
}
/** Deactivate an event (sets is_active = false). */
export async function deactivateEvent(id: string): Promise<void> {
const { error } = await supabase.from('events').update({ is_active: false }).eq('id', id);
if (error) throw new ApiError(error.message);
}
// ---- Points ------------------------------------------------------------------
/** Admin manual points adjustment for the active event (audited as 'admin'). */