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
@@ -4,6 +4,8 @@
import { createEventDispatcher } from 'svelte';
import { onMount, getContext } from 'svelte';
import { goto } from '$app/navigation';
import { updateUserById, getUserGroupsById } from '$lib/apis/users';
import Modal from '$lib/components/common/Modal.svelte';
@@ -127,7 +129,10 @@
<div class="flex flex-wrap gap-1 my-0.5 -mx-1">
{#each userGroups as userGroup}
<span class="px-2 py-0.5 rounded-full bg-gray-100 dark:bg-gray-850 text-xs">
<a href={"/admin/users/groups?id=" + userGroup.id}
on:click|preventDefault={() => goto('/admin/users/groups?id=' + userGroup.id)}>
{userGroup.name}
</a>
</span>
{/each}
</div>