refactor(mail): #28 un seul template email parent (principal + co-parent)
Made-with: Cursor
This commit is contained in:
@@ -286,20 +286,8 @@ export class UserService {
|
||||
savedUser.token_creation_mdp_expire_le = exp;
|
||||
await this.usersRepository.save(savedUser);
|
||||
|
||||
let kind: ValidationAccountEmailKind = 'am';
|
||||
if (savedUser.role === RoleType.ASSISTANTE_MATERNELLE) {
|
||||
kind = 'am';
|
||||
} else if (savedUser.numero_dossier) {
|
||||
const parentsDossier = await this.usersRepository.find({
|
||||
where: { numero_dossier: savedUser.numero_dossier, role: RoleType.PARENT },
|
||||
order: { cree_le: 'ASC' },
|
||||
});
|
||||
const premier = parentsDossier[0];
|
||||
kind =
|
||||
premier && premier.id !== savedUser.id ? 'parent_coparent' : 'parent_primary';
|
||||
} else {
|
||||
kind = 'parent_primary';
|
||||
}
|
||||
const kind: ValidationAccountEmailKind =
|
||||
savedUser.role === RoleType.ASSISTANTE_MATERNELLE ? 'am' : 'parent';
|
||||
|
||||
await this.mailService.sendValidatedAccountPasswordSetupEmail(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user