Skip to content

Commit

Permalink
fix: les adresses peuvent planter quand la région n'est pas trouvée (…
Browse files Browse the repository at this point in the history
…api v2 v3)
  • Loading branch information
rap2hpoutre committed Oct 6, 2023
1 parent be2b69c commit d52d65c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/src/common/actions/engine/engine.actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const completeEffectifAddress = async <T extends Partial<Effectif>>(effec
return effectifData;
}

effectifDataWithAddress.apprenant.adresse = {
effectifDataWithAddress.apprenant.adresse = stripEmptyFields({
...effectifDataWithAddress.apprenant.adresse,
commune: adresseInfo.commune,
code_insee: adresseInfo.code_commune_insee,
Expand All @@ -89,7 +89,7 @@ export const completeEffectifAddress = async <T extends Partial<Effectif>>(effec
? (adresseInfo.num_academie?.toString() as any)
: undefined,
region: REGIONS_BY_CODE[adresseInfo.num_region] ? (adresseInfo.num_region as any) : undefined,
};
});

return effectifDataWithAddress;
};
Expand Down

0 comments on commit d52d65c

Please sign in to comment.