Skip to content

Commit

Permalink
🔀 Intégration des modifications de la release 3.31 (#2296)
Browse files Browse the repository at this point in the history
  • Loading branch information
JulienPavon authored Oct 9, 2024
2 parents 4fcb985 + d74d1a1 commit 24fb0f2
Showing 1 changed file with 23 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { Option } from '@potentiel-libraries/monads';
import { User } from '../../entities';
import { logger } from '../../core/utils';
import { Recours } from '@potentiel-domain/elimine';
import { getLogger } from '@potentiel-libraries/monitoring';
const schema = yup.object({
params: yup.object({ projectId: yup.string().required() }),
});
Expand Down Expand Up @@ -121,20 +122,28 @@ v1Router.get(
);
const abandon = await getAbandon(identifiantProjetValueType);

const alertesRaccordement =
!abandon || abandon.statut === 'rejeté'
? await getAlertesRaccordement({
userRole: user.role,
identifiantProjet: identifiantProjetValueType,
CDC2022Choisi:
projet.cahierDesChargesActuel.type === 'modifié' &&
projet.cahierDesChargesActuel.paruLe === '30/08/2022',
projet: {
isClasse: projet.isClasse,
isAbandonned: projet.isAbandoned,
},
})
: undefined;
let alertesRaccordement: AlerteRaccordement[] | undefined = undefined;
try {
alertesRaccordement =
!abandon || abandon.statut === 'rejeté'
? await getAlertesRaccordement({
userRole: user.role,
identifiantProjet: identifiantProjetValueType,
CDC2022Choisi:
projet.cahierDesChargesActuel.type === 'modifié' &&
projet.cahierDesChargesActuel.paruLe === '30/08/2022',
projet: {
isClasse: projet.isClasse,
isAbandonned: projet.isAbandoned,
},
})
: undefined;
} catch (error) {
getLogger().warn(`An error occurred when getting raccordements alerts`, {
error,
identifiantProjetValueType,
});
}

const rawProjectEventList = await getProjectEvents({ projectId: projet.id, user });

Expand Down

0 comments on commit 24fb0f2

Please sign in to comment.