Skip to content

Commit

Permalink
feat: ajout d'une erreur en cas de duplicat
Browse files Browse the repository at this point in the history
  • Loading branch information
Pomarom committed Mar 22, 2024
1 parent 88fc4e9 commit 736b273
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/src/common/actions/effectifs.actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,9 +409,9 @@ export const createEffectifFromForm = async (data: IEffectifCreationSchema, orga
"formation.cfd": newEffectif.formation?.cfd,
"formation.annee": newEffectif.formation?.annee,
}));
// if (found) {
// throw
// }
if (found) {
throw Boom.conflict("L'effectif existe déjà");
}
await effectifsDb().insertOne(newEffectif);
return;
};

0 comments on commit 736b273

Please sign in to comment.