Skip to content

Commit

Permalink
fix(api): 137 : Corriger la synchro JVA V3 (#4697)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicobret authored Jan 27, 2025
1 parent ff86b5f commit 9b0cc96
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api/src/crons/missionsJVA/JVAService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,12 @@ export async function syncMissions() {
async function syncMission(mission: JeVeuxAiderMission): Promise<MissionDocument | undefined> {
logger.info(`Syncing mission ${mission.clientId}: ${mission.title}`);

if (JvaStructureException.includes(mission.organizationId)) {
logger.info(`Structure ${mission.organizationId} is in JVA exception list, skipping mission ${mission.clientId}`);
if (JvaStructureException.includes(mission.organizationClientId.toString())) {
logger.info(`Structure ${mission.organizationClientId} is in JVA exception list, skipping mission ${mission.clientId}`);
return;
}

let structure = await StructureModel.findOne({ jvaStructureId: mission.organizationId });
let structure = await StructureModel.findOne({ jvaStructureId: mission.organizationClientId });
if (!structure) {
const newStructure = await createStructure(mission);
if (!newStructure) throw new Error("No structure created");
Expand Down

0 comments on commit 9b0cc96

Please sign in to comment.