From bf413f2a267860571a9cbec49c956f305f81630e Mon Sep 17 00:00:00 2001 From: Fulmine Date: Sat, 19 Mar 2022 12:42:11 +0100 Subject: [PATCH] sort group list in member page alphabetically --- src/pages/Member.svelte | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/Member.svelte b/src/pages/Member.svelte index 1cb8edb2..54609f9b 100644 --- a/src/pages/Member.svelte +++ b/src/pages/Member.svelte @@ -35,7 +35,8 @@ $: indexOfFirstItem = indexOfLastItem - itemsPerPage; $: pageAmount = Math.ceil(groups.length / itemsPerPage); - $: slicedGroups = groups.slice(indexOfFirstItem, indexOfLastItem); + $: orderedGroups = groups.sort((a, b) => a.name.localeCompare(b.name)); + $: slicedGroups = orderedGroups.slice(indexOfFirstItem, indexOfLastItem); onMount(() => { fetchMember();