Skip to content

Commit

Permalink
fix: tri les notifs sur la date de demarrage
Browse files Browse the repository at this point in the history
  • Loading branch information
GregoireDucharme committed Jan 10, 2025
1 parent 0e756a5 commit ea9849f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/components/records/NotificationState.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/certification/exploitations/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/exploitations/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit ea9849f

Please sign in to comment.