From ea9849fc2817d22ff48e7dff9323c976c5fbb42c Mon Sep 17 00:00:00 2001 From: GregoireDucharme Date: Fri, 10 Jan 2025 15:42:33 +0100 Subject: [PATCH] fix: tri les notifs sur la date de demarrage --- src/components/records/NotificationState.vue | 3 ++- src/pages/certification/exploitations/index.vue | 2 +- src/pages/exploitations/index.vue | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/records/NotificationState.vue b/src/components/records/NotificationState.vue index e781331c..60db1d12 100644 --- a/src/components/records/NotificationState.vue +++ b/src/components/records/NotificationState.vue @@ -41,7 +41,8 @@ const displayedNotif = computed(() => { // L'oc connecté a des notifications le conernant on ne traite que celle-ci array = array.filter((n) => n.organismeCertificateurId === user.organismeCertificateur.id); } - array.sort((a, b) => new Date(b.dateSignatureContrat) - new Date(a.dateSignatureContrat)); + + array.sort((a, b) => new Date(b.dateDemarrage) - new Date(a.dateDemarrage)); for (const notif of array) { const currentStatut = notif.etatCertification || notif.status; diff --git a/src/pages/certification/exploitations/index.vue b/src/pages/certification/exploitations/index.vue index ed8d014d..f8161bca 100644 --- a/src/pages/certification/exploitations/index.vue +++ b/src/pages/certification/exploitations/index.vue @@ -357,7 +357,7 @@ async function doSearch(input, page, sort, order) { function getDateDemarrage(operator) { const array = operator.certificats ?? operator.notifications ?? []; - array.sort((a, b) => new Date(b.dateSignatureContrat) - new Date(a.dateSignatureContrat)); + array.sort((a, b) => new Date(b.dateDemarrage) - new Date(a.dateDemarrage)); let dateDemarrage; for (const notif of array) { diff --git a/src/pages/exploitations/index.vue b/src/pages/exploitations/index.vue index 079b8711..e8c6191f 100644 --- a/src/pages/exploitations/index.vue +++ b/src/pages/exploitations/index.vue @@ -114,7 +114,7 @@ async function loadOperators() { function getDateDemarrage(operator) { const array = operator.certificats ?? operator.notifications ?? []; - array.sort((a, b) => new Date(b.dateSignatureContrat) - new Date(a.dateSignatureContrat)); + array.sort((a, b) => new Date(b.dateDemarrage) - new Date(a.dateDemarrage)); let dateDemarrage; for (const notif of array) {