Skip to content

Commit

Permalink
fix(whatsapp): join link
Browse files Browse the repository at this point in the history
  • Loading branch information
guillobits committed Sep 27, 2024
1 parent 695dddd commit 470398a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/auth/auth.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export class AuthController {
updatedUser.email
);

return currentUser.toJSON();
return currentUser;
}

@Public()
Expand Down
2 changes: 1 addition & 1 deletion src/auth/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class AuthService {
await this.usersService.findOneComplete(user.id);

if (validatePassword(password, userPassword, userSalt)) {
return user.toJSON();
return user;
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/users/models/user.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion src/utils/types/WhatsappZone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 470398a

Please sign in to comment.