Skip to content

Commit cdc7bf1

Browse files
committed
fix(api):use correct AAP emai address for new candidacies
1 parent 836fcf1 commit cdc7bf1

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

packages/reva-api/modules/candidacy/features/getReferentOrganismFromCandidacyId.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@ export const getReferentOrganismFromCandidacyId = async ({
99
try {
1010
const candidacy = await prismaClient.candidacy.findUnique({
1111
where: { id: candidacyId },
12-
include: { organism: true },
12+
include: {
13+
organism: {
14+
include: {
15+
organismInformationsCommerciales: true,
16+
},
17+
},
18+
},
1319
});
1420

1521
if (!candidacy) {

packages/reva-api/modules/candidacy/features/submitCandidacy.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,17 @@ export const submitCandidacy = async ({
5858
`Impossible de trouver l'organisme pour la candidature ${candidacy.id}`,
5959
);
6060
}
61-
await sendNewCandidacyEmail({ email: organism.contactAdministrativeEmail });
61+
await sendNewCandidacyEmail({
62+
email:
63+
organism.organismInformationsCommerciales?.emailContact ??
64+
organism.contactAdministrativeEmail,
65+
});
6266
await sendConfirmationCandidacySubmissionEmail({
6367
email: candidate.email as string,
6468
organismName: organism.label,
65-
organismEmail: organism.contactAdministrativeEmail,
69+
organismEmail:
70+
organism.organismInformationsCommerciales?.emailContact ??
71+
organism.contactAdministrativeEmail,
6672
candidacyFundedByFranceVae: candidacy.financeModule !== "hors_plateforme",
6773
});
6874
return updatedCandidacy;

0 commit comments

Comments
 (0)