Skip to content

Commit

Permalink
fix: retour maj email
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Perrin committed Jul 29, 2024
1 parent a77dd48 commit 78d77c6
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions backend/src/http/api/backoffice/gestion-organismes-routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ module.exports = ({ db, configuration, emails, middlewares, logger }) => {

router.put('/api/backoffice/moderateur/organismes/:id/updateCourriel', checkAuth, checkProfile('moderateur'), tryAndCatch(async (req, res) => {

let idNonModifie = (await Joi.validate(req.params, { id: Joi.required() }, { abortEarly: false })).id;
let idNonModifie = (await Joi.validate(req.params, { id: Joi.string().required() }, { abortEarly: false })).id;

let bonId = await recupererIdOrganisme(idNonModifie);

Expand Down Expand Up @@ -171,11 +171,22 @@ module.exports = ({ db, configuration, emails, middlewares, logger }) => {
ip: getRemoteAddress(req)
});

return res.status(201).send(result.value);
return res.status(201).send(await db.collection('accounts').findOne({ _id: organisme._id },
{
projection: {
profile: true,
codeRegion: true,
siret: true,
courriel: true,
courriels: true,
raison_sociale: true,
}
}
));
}));

router.post('/api/backoffice/moderateur/organismes/:id/resendEmailAccount', checkAuth, checkProfile('moderateur'), tryAndCatch(async (req, res) => {
let idNonModifie = (await Joi.validate(req.params, { id: Joi.required() }, { abortEarly: false })).id;
let idNonModifie = (await Joi.validate(req.params, { id: Joi.string().required() }, { abortEarly: false })).id;

let bonId = await recupererIdOrganisme(idNonModifie);

Expand Down

0 comments on commit 78d77c6

Please sign in to comment.