From 9bc2bf9e95e33643fa59499f3124749e421c4062 Mon Sep 17 00:00:00 2001 From: paidge <paidge_cs@hotmail.com> Date: Tue, 1 Feb 2022 14:02:45 +0100 Subject: [PATCH] reapre sorting in MemberList --- components/member/List.vue | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/components/member/List.vue b/components/member/List.vue index e14ed56..77730ae 100644 --- a/components/member/List.vue +++ b/components/member/List.vue @@ -148,7 +148,7 @@ export default { if (this.certif) return member.received_certifications.limit return Math.min(member.limitDate, member.received_certifications.limit) }, - sort(a, b, order) { + getOrder(a, b, order) { if (a < b) return -1 * order if (a > b) return 1 * order return 0 @@ -157,23 +157,26 @@ export default { computed: { membersSorted() { return this.members - .slice() .sort((a, b) => { let modifier = this.currentSortDir === "desc" ? -1 : 1 if (this.currentSort == "uid") { - this.sort(a["uid"].toLowerCase(), b["uid"].toLowerCase(), modifier) + return this.getOrder( + a["uid"].toLowerCase(), + b["uid"].toLowerCase(), + modifier + ) } else if (this.currentSort == "pubkey") { - this.sort( + return this.getOrder( a["pubkey"].toLowerCase(), b["pubkey"].toLowerCase(), modifier ) } else if (this.currentSort == "date_sortie") { if (this.adhesion) { - this.sort(a["limitDate"], b["limitDate"], modifier) + return this.getOrder(a["limitDate"], b["limitDate"], modifier) } else if (this.certif) { - this.sort( + return this.getOrder( a["received_certifications"]["limit"], b["received_certifications"]["limit"], modifier @@ -187,7 +190,7 @@ export default { b["limitDate"], b["received_certifications"]["limit"] ) - this.sort(minA, minB, modifier) + return this.getOrder(minA, minB, modifier) } } return 0 -- GitLab