From 16ae1c4b122030a173cde93342d439c86a1268bc Mon Sep 17 00:00:00 2001 From: Albin Medoc Date: Sat, 30 Nov 2024 20:14:57 +0100 Subject: [PATCH] Don't allow deleting default group --- src/routes/admin/groups/[groupId]/members/+page.svelte | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/routes/admin/groups/[groupId]/members/+page.svelte b/src/routes/admin/groups/[groupId]/members/+page.svelte index 27d8cbf..47afce0 100644 --- a/src/routes/admin/groups/[groupId]/members/+page.svelte +++ b/src/routes/admin/groups/[groupId]/members/+page.svelte @@ -65,6 +65,14 @@ }; const deleteGroup = () => { + if (data.config.defaultGroup === $page.params.groupId) { + modalStore.trigger({ + type: "alert", + title: "Cannot Delete Default Group", + body: "You cannot delete the default group. Please change the default group before deleting this group." + }); + return; + } modalStore.trigger({ type: "confirm", title: "Delete Group",