Fix inconsistent PAT display order (#4662)

* Fix inconsistent PAT display order
Closes #4661

* Fix side effect in computed property

* Fix lint

---------

Co-authored-by: Calum H. <contact@cal.engineer>
This commit is contained in:
thedarkcolour
2025-10-30 16:28:18 -07:00
committed by GitHub
parent 1dd7e3bcdc
commit 00f9cf0e2c

View File

@@ -100,7 +100,7 @@
</template>
</IntlFormatted>
</p>
<div v-for="(pat, index) in pats" :key="pat.id" class="universal-card recessed token">
<div v-for="(pat, index) in displayPats" :key="pat.id" class="universal-card recessed token">
<div>
<div>
<strong>{{ pat.name }}</strong>
@@ -332,6 +332,9 @@ const deletePatIndex = ref(null)
const loading = ref(false)
const { data: pats, refresh } = await useAsyncData('pat', () => useBaseFetch('pat'))
const displayPats = computed(() => {
return pats.value.toSorted((a, b) => new Date(b.created) - new Date(a.created))
})
async function createPat() {
startLoading()