sort group list in member page alphabetically

This commit is contained in:
Fulmine 2022-03-19 12:42:11 +01:00
parent c58556fa8d
commit bf413f2a26

View File

@ -35,7 +35,8 @@
$: indexOfFirstItem = indexOfLastItem - itemsPerPage; $: indexOfFirstItem = indexOfLastItem - itemsPerPage;
$: pageAmount = Math.ceil(groups.length / 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(() => { onMount(() => {
fetchMember(); fetchMember();