From 9eb3f827c2753a95b413714248d3f9a427976a25 Mon Sep 17 00:00:00 2001 From: Eric SANCHEZ Date: Fri, 24 Jan 2025 11:32:27 +0100 Subject: [PATCH] fix departSejourMotif types --- api/src/crons/autoValidatePhase1.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/crons/autoValidatePhase1.ts b/api/src/crons/autoValidatePhase1.ts index 5ffcc4d6eb..504de7a945 100644 --- a/api/src/crons/autoValidatePhase1.ts +++ b/api/src/crons/autoValidatePhase1.ts @@ -4,7 +4,7 @@ import { updateStatusPhase1 } from "../utils"; import { capture } from "../sentry"; import slack from "../slack"; import { CohortModel, LigneBusModel, YoungModel } from "../models"; -import { getDepartureDate, YOUNG_STATUS, YOUNG_STATUS_PHASE1, DEPART_SEJOUR_MOTIFS_NOT_DONE, DepartSejourMotif } from "snu-lib"; +import { getDepartureDate, YOUNG_STATUS, YOUNG_STATUS_PHASE1, DEPART_SEJOUR_MOTIFS_NOT_DONE } from "snu-lib"; export const handler = async (): Promise => { try { @@ -32,7 +32,7 @@ export const handler = async (): Promise => { const dateStart = getDepartureDate(young, sessionPhase1, cohort, { bus }); if (differenceInDays(now, dateStart) <= cohort.daysToValidate) { - const isMotifNotDone = young.departSejourMotif && DEPART_SEJOUR_MOTIFS_NOT_DONE.includes(young.departSejourMotif as DepartSejourMotif); + const isMotifNotDone = young.departSejourMotif && DEPART_SEJOUR_MOTIFS_NOT_DONE.includes(young.departSejourMotif as (typeof DEPART_SEJOUR_MOTIFS_NOT_DONE)[number]); if (isMotifNotDone) { young.set({ statusPhase1: YOUNG_STATUS_PHASE1.NOT_DONE });