Skip to content

Commit 96eb029

Browse files
committed
sort + add id to admin user list
1 parent 8515a8d commit 96eb029

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

frontend/src/routes/admin/+page.svelte

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@
162162
<table class="min-w-full divide-y divide-gray-200">
163163
<thead class="bg-ctp-base">
164164
<tr>
165+
<th class="px-6 py-3 text-left text-xs font-medium text-ctp-subtext0 uppercase"
166+
>Id</th
167+
>
165168
<th class="px-6 py-3 text-left text-xs font-medium text-ctp-subtext0 uppercase"
166169
>User</th
167170
>
@@ -180,8 +183,14 @@
180183
</tr>
181184
</thead>
182185
<tbody class="bg-ctp-mantle divide-y divide-ctp-surface1">
183-
{#each adminData.stats.all_users as user (user.github_id)}
186+
{#each [...adminData.stats.all_users].sort((a, b) => {
187+
if (a.is_admin === b.is_admin) return (a.id ?? 0) - (b.id ?? 0);
188+
return a.is_admin ? -1 : 1;
189+
}) as user (user.github_id)}
184190
<tr>
191+
<td class="px-6 py-4 whitespace-nowrap text-sm text-ctp-subtext1"
192+
>{user.id}</td
193+
>
185194
<td class="px-6 py-4 whitespace-nowrap">
186195
<div class="flex items-center">
187196
{#if user.avatar_url}

0 commit comments

Comments
 (0)