Skip to content

Commit

Permalink
fix: mise a jour du filtre mission locale sur les niveaux
Browse files Browse the repository at this point in the history
  • Loading branch information
Pomarom committed Dec 20, 2024
1 parent ac45a48 commit 6181720
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion server/src/common/actions/helpers/filters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const effectifsFiltersMissionLocaleSchema = {
.optional(),
rqth: zBooleanStringSchema.optional(),
mineur: zBooleanStringSchema.optional(),
niveau: z.array(z.string()).optional(),
niveaux: z.array(z.string()).optional(),
code_insee: z.array(z.string()).optional(),
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const EFF_MISSION_LOCALE_FILTER = [
];

export const buildFiltersForMissionLocale = (effectifFilters: IEffectifsFiltersMissionLocale) => {
const { statut = null, rqth = null, mineur = null, niveau = null, code_insee = null } = effectifFilters;
const { statut = null, rqth = null, mineur = null, niveaux = null, code_insee = null } = effectifFilters;
const filter = [
...filterByDernierStatutPipeline(
(statut as Array<StatutApprenant>) ?? [
Expand All @@ -36,7 +36,7 @@ export const buildFiltersForMissionLocale = (effectifFilters: IEffectifsFiltersM
...(mineur !== null
? { "apprenant.date_de_naissance": { $gte: new Date(new Date().setFullYear(new Date().getFullYear() - 18)) } }
: {}),
...(niveau ? {} : {}),
...(niveaux ? { "formation.niveau": { $in: niveaux } } : {}),
...(code_insee ? { "apprenant.adresse.code_insee": { $in: code_insee } } : {}),
},
},
Expand Down

0 comments on commit 6181720

Please sign in to comment.