feat: Allow navigating to user group from user edit

This commit allow navigating from user edit to user group, allowing faster updates to groups.
The querystringValue function was moved to lib/utils to reuse it in multiple places.
This commit is contained in:
Athanasios Oikonomou
2025-08-12 01:08:56 +03:00
committed by Athanasios Oikonomou
parent 62506b1955
commit 5543f30c49
4 changed files with 21 additions and 8 deletions
@@ -1,6 +1,6 @@
<script>
import { toast } from 'svelte-sonner';
import { getContext } from 'svelte';
import { onMount, getContext } from 'svelte';
const i18n = getContext('i18n');
@@ -10,6 +10,7 @@
import User from '$lib/components/icons/User.svelte';
import UserCircleSolid from '$lib/components/icons/UserCircleSolid.svelte';
import GroupModal from './EditGroupModal.svelte';
import { querystringValue } from '$lib/utils';
export let users = [];
export let group = {
@@ -44,6 +45,13 @@
setGroups();
}
};
onMount(() => {
const groupId = querystringValue('id')
if (groupId && groupId === group.id) {
showEdit = true;
}
});
</script>
<GroupModal