Loading backend/src/auth/user/authUsercontroller.ts +10 −12 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ import { import { AuthUserService } from './authUserservice'; import { CreateUserDto } from 'src/user/dto/create-user.dto'; import { LoginUserDto } from './dto/login-user.dto'; import { UserSigninResDto } from './dto/user-signin-res.dto'; @Controller('') @ApiTags('Create user account and sign in as user') Loading @@ -18,31 +19,28 @@ export class AuthUserController { @ApiBody({ type: CreateUserDto }) @ApiBearerAuth() @ApiCreatedResponse({ content: { 'application/json': { example: { token: 'token', }, }, }, type: UserSigninResDto, }) @Post('user/signup') async signUp(@Body() createAdminDto: CreateUserDto) { try { const accessToken = await this.authUserService.signUp(createAdminDto); return { token: accessToken }; const adminSigninResDto = await this.authUserService.signUp(createAdminDto); return { user: adminSigninResDto }; } catch (e) { throw e; } } @ApiBody({ type: LoginUserDto }) @ApiCreatedResponse({ type: UserSigninResDto, }) @ApiUnauthorizedResponse() @Post('user/signin') async signIn(@Body() loginAdminDto: LoginUserDto) { try { const adminSigninResDto = await this.authUserService.signIn(loginAdminDto); return adminSigninResDto; const userSigninResDto = await this.authUserService.signIn(loginAdminDto); return { user: userSigninResDto }; } catch (e) { throw e; } Loading Loading
backend/src/auth/user/authUsercontroller.ts +10 −12 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ import { import { AuthUserService } from './authUserservice'; import { CreateUserDto } from 'src/user/dto/create-user.dto'; import { LoginUserDto } from './dto/login-user.dto'; import { UserSigninResDto } from './dto/user-signin-res.dto'; @Controller('') @ApiTags('Create user account and sign in as user') Loading @@ -18,31 +19,28 @@ export class AuthUserController { @ApiBody({ type: CreateUserDto }) @ApiBearerAuth() @ApiCreatedResponse({ content: { 'application/json': { example: { token: 'token', }, }, }, type: UserSigninResDto, }) @Post('user/signup') async signUp(@Body() createAdminDto: CreateUserDto) { try { const accessToken = await this.authUserService.signUp(createAdminDto); return { token: accessToken }; const adminSigninResDto = await this.authUserService.signUp(createAdminDto); return { user: adminSigninResDto }; } catch (e) { throw e; } } @ApiBody({ type: LoginUserDto }) @ApiCreatedResponse({ type: UserSigninResDto, }) @ApiUnauthorizedResponse() @Post('user/signin') async signIn(@Body() loginAdminDto: LoginUserDto) { try { const adminSigninResDto = await this.authUserService.signIn(loginAdminDto); return adminSigninResDto; const userSigninResDto = await this.authUserService.signIn(loginAdminDto); return { user: userSigninResDto }; } catch (e) { throw e; } Loading