diff --git a/back/volume/src/users/users.controller.ts b/back/volume/src/users/users.controller.ts index 7dfd02c..1ddcb89 100644 --- a/back/volume/src/users/users.controller.ts +++ b/back/volume/src/users/users.controller.ts @@ -212,9 +212,9 @@ export class UsersController { async updateUser ( @Body() payload: UserDto, @Profile42() profile: Profile - ): Promise { + ): Promise { const user = await this.usersService.findUser(profile.id) if (user == null) throw new BadRequestException('User not found.') - return await this.usersService.update(user, payload) + await this.usersService.update(user, payload) } } diff --git a/back/volume/src/users/users.service.ts b/back/volume/src/users/users.service.ts index f17fa53..e15ab33 100644 --- a/back/volume/src/users/users.service.ts +++ b/back/volume/src/users/users.service.ts @@ -20,7 +20,7 @@ export class UsersService { } async update (user: User, changes: UserDto): Promise { - this.usersRepository.update({id: user.id}, changes) + await this.usersRepository.update({ id: user.id }, changes) } async findUsers (): Promise { @@ -57,10 +57,10 @@ export class UsersService { async findUser (ftId: number): Promise { const user = await this.usersRepository.findOneBy({ ftId }) - if (user == null) throw new BadRequestException("User not exist") + if (user == null) throw new BadRequestException('User not exist') user.lastAccess = Date.now() if (user.status === 'offline') user.status = 'online' - await this.update.(user) + await this.update(user, user) return user }