Skip to content

Commit

Permalink
debug πŸ›
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentlaine committed Sep 25, 2024
1 parent 3c0eac0 commit 3051598
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/arretes_restrictions/arretes_restrictions.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@ export class ArretesRestrictionsService {
'crise': 4,
};
return ars.map(ar => {
ar.niveauGraviteMax = ar.restrictions.length > 0 ? ar.restrictions.reduce((acc, restriction) => {
if (niveauGravitePriority[restriction.status] > niveauGravitePriority[acc.status]) {
return restriction;
ar.niveauGraviteMax = null;
ar.restrictions?.forEach(r => {
if (!ar.niveauGraviteMax || niveauGravitePriority[r.status] > niveauGravitePriority[ar.niveauGraviteMax]) {
ar.niveauGraviteMax = r.niveauGravite;
}
return acc;
}).niveauGravite : null;
});
ar.types = ar.restrictions.map(r => r.zonesAlerteComputed.map(z => z.type)).flat();
ar.types = [...new Set(ar.types)].sort();
return ar;
Expand Down

0 comments on commit 3051598

Please sign in to comment.