From 918c113643878effe942537e6719b3955e7583f3 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Fri, 26 May 2023 21:57:09 +0900 Subject: [PATCH] Fix guest user settings --- back/src/auth/auth.controller.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/back/src/auth/auth.controller.ts b/back/src/auth/auth.controller.ts index 710d980..833ac97 100644 --- a/back/src/auth/auth.controller.ts +++ b/back/src/auth/auth.controller.ts @@ -46,9 +46,8 @@ export class AuthController { @Post('register') async register(@Body() registerDto: RegisterDto): Promise { try { - await this.usersService.createUser(registerDto).then((user) => { - this.settingsService.createUserSetting(user.id); - }); + const user = await this.usersService.createUser(registerDto) + await this.settingsService.createUserSetting(user.id); } catch { throw new BadRequestException(); } @@ -66,6 +65,7 @@ export class AuthController { @Post('guest') async guest(): Promise { const user = await this.usersService.createGuest(); + await this.settingsService.createUserSetting(user.id); return this.authService.login(user); }