From 470398a2810e16f1b17ecbf4e7ca5cb825571c45 Mon Sep 17 00:00:00 2001 From: Guillaume Cauchois Date: Fri, 27 Sep 2024 17:27:41 +0200 Subject: [PATCH] fix(whatsapp): join link --- src/auth/auth.controller.ts | 2 +- src/auth/auth.service.ts | 2 +- src/users/models/user.model.ts | 6 +++--- src/utils/types/WhatsappZone.ts | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/auth/auth.controller.ts b/src/auth/auth.controller.ts index 1f165140..232f16f2 100644 --- a/src/auth/auth.controller.ts +++ b/src/auth/auth.controller.ts @@ -162,7 +162,7 @@ export class AuthController { updatedUser.email ); - return currentUser.toJSON(); + return currentUser; } @Public() diff --git a/src/auth/auth.service.ts b/src/auth/auth.service.ts index 38f19af3..4b9a0508 100644 --- a/src/auth/auth.service.ts +++ b/src/auth/auth.service.ts @@ -29,7 +29,7 @@ export class AuthService { await this.usersService.findOneComplete(user.id); if (validatePassword(password, userPassword, userSalt)) { - return user.toJSON(); + return user; } } diff --git a/src/users/models/user.model.ts b/src/users/models/user.model.ts index 1884eaf7..93881f39 100644 --- a/src/users/models/user.model.ts +++ b/src/users/models/user.model.ts @@ -178,21 +178,21 @@ export class User extends HistorizedModel { get whatsappZoneCoachName(): string { const zone = this.getDataValue('zone') as AdminZone; const isCoach = this.getDataValue('role') === UserRoles.COACH; - return isCoach && WhatsappByZone[zone] ? WhatsappByZone[zone].name : null; + return isCoach && zone ? WhatsappByZone[zone].name : ''; } @Column(DataType.VIRTUAL) get whatsappZoneCoachUrl(): string { const zone = this.getDataValue('zone') as AdminZone; const isCoach = this.getDataValue('role') === UserRoles.COACH; - return isCoach && WhatsappByZone[zone] ? WhatsappByZone[zone].url : null; + return isCoach && zone ? WhatsappByZone[zone].url : ''; } @Column(DataType.VIRTUAL) get whatsappZoneCoachQR(): string { const zone = this.getDataValue('zone') as AdminZone; const isCoach = this.getDataValue('role') === UserRoles.COACH; - return isCoach && WhatsappByZone[zone] ? WhatsappByZone[zone].qr : null; + return isCoach && zone ? WhatsappByZone[zone].qr : ''; } @BelongsToMany( diff --git a/src/utils/types/WhatsappZone.ts b/src/utils/types/WhatsappZone.ts index 2a63d61c..71757a67 100644 --- a/src/utils/types/WhatsappZone.ts +++ b/src/utils/types/WhatsappZone.ts @@ -19,7 +19,7 @@ export const WhatsappByZone = { [AdminZones.RENNES]: { name: 'Bretagne // Rennes & Lorient', qr: '/static/img/whatsapp-qrcode-coach/whatsapp-qrcode-rennes-lorient.png', - url: process.env.WHATSAPP_COACH_URL_RENNES_ORIENT as string, + url: process.env.WHATSAPP_COACH_URL_RENNES_LORIENT as string, }, [AdminZones.LORIENT]: { name: 'Bretagne // Rennes & Lorient',