From 829102dbede4205ad7bb0c3527dd8b8539a52cae Mon Sep 17 00:00:00 2001 From: DimitriRomano Date: Thu, 22 Feb 2024 14:26:13 +0100 Subject: [PATCH] fix auth service --- src/appointments/appointments.service.ts | 2 ++ src/auth/auth.service.ts | 7 +++++-- src/users/dto/create-user.dto.ts | 1 - 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/appointments/appointments.service.ts b/src/appointments/appointments.service.ts index e022dcb..05fd45b 100644 --- a/src/appointments/appointments.service.ts +++ b/src/appointments/appointments.service.ts @@ -30,6 +30,8 @@ export class AppointmentsService { }); } + // updateStatus(appointmentId: string, status: App) { + findAll() { return this.prismaService.appointment.findMany(); } diff --git a/src/auth/auth.service.ts b/src/auth/auth.service.ts index 92b98a3..4484c77 100644 --- a/src/auth/auth.service.ts +++ b/src/auth/auth.service.ts @@ -87,8 +87,11 @@ export class AuthService { }; } - async createAccessToken(userId: string) { - return this.jwtService.sign({ userId: userId }, { expiresIn: '15m' }); + async createAccessToken(userId: string, role: Role) { + return this.jwtService.sign( + { userId: userId, role: role }, + { expiresIn: '15m' }, + ); } async createRefreshToken(userId: string, role: Role) { diff --git a/src/users/dto/create-user.dto.ts b/src/users/dto/create-user.dto.ts index 59cc327..acab218 100644 --- a/src/users/dto/create-user.dto.ts +++ b/src/users/dto/create-user.dto.ts @@ -14,7 +14,6 @@ import { // DERMATOLOGUE = 'DERMATOLOGUE', // } export class CreateUserDto { - @IsNotEmpty() @IsString() @ApiProperty()