diff --git a/modules/auth/auth.controller.js b/modules/auth/auth.controller.js index 9223360..83afba0 100644 --- a/modules/auth/auth.controller.js +++ b/modules/auth/auth.controller.js @@ -205,8 +205,12 @@ async function register(req, res, next) { newUser = await authService.extraMethods.updateUser(newUser.id, data); try { - const userDTO = marketingService.userToMarktingDTO(newUser); - marketing.updateMemberByEmail(oldUserData.email, userDTO); + const userDTO = marketingService.userToMarketingDTO(newUser); + if (await marketing.getMemberByEmail(newUser.email)) { + marketing.updateMemberByEmail(oldUserData.email, userDTO); + } else { + // No mandar a Sendinblue hasta que no se inscriba en un congreso. + } } catch (err) { console.error(err); } @@ -534,7 +538,7 @@ async function deleteUser(req, res, next) { // Delete in Sendinblue try { - const userDTO = marketingService.userToMarktingDTO(dataUser); + const userDTO = marketingService.userToMarketingDTO(dataUser); marketing.deleteMemberByEmail(userDTO.email); } catch (error) { console.error(error);