Skip to content

Commit

Permalink
sort renewal list
Browse files Browse the repository at this point in the history
  • Loading branch information
Lenni009 committed Jan 5, 2025
1 parent b7f1bf7 commit fc4f733
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/renew/UserTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ const { censusData } = storeToRefs(censusDataStore);
const paginatedEntries = ref<CensusEntry[]>([]);
const filteredCensusData = computed(() =>
censusData.value.filter((item) => item.CensusPlayer.toLowerCase().includes(props.filter.toLowerCase()))
censusData.value
.filter((item) => item.CensusPlayer.toLowerCase().includes(props.filter.toLowerCase()))
.toSorted((a, b) => {
if (a.renewed === b.renewed) return a.CensusPlayer.toLowerCase() > b.CensusPlayer.toLowerCase() ? 1 : -1;
return a.renewed > b.renewed ? 1 : -1;
})
);
const updateEntries = (newPaginatedArray: CensusEntry[]) => (paginatedEntries.value = newPaginatedArray);
Expand Down

0 comments on commit fc4f733

Please sign in to comment.