diff --git a/apps/backend/src/user/user.controller.ts b/apps/backend/src/user/user.controller.ts index 6b91ff2..ce6390e 100644 --- a/apps/backend/src/user/user.controller.ts +++ b/apps/backend/src/user/user.controller.ts @@ -1,4 +1,5 @@ import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common'; +import { User } from '@prisma/client'; import { AuthService } from 'src/auth/auth.service'; import { CreateUserDto } from './dto/create-user.dto'; @@ -17,6 +18,11 @@ export class UserController { return this.userService.create(createUserDto); } + @Post('login') + async logIn(@Body() loginDto: { email: string; passWord: string }): Promise { + return await this.authService.signIn(loginDto.email, loginDto.passWord); + } + @Get() findAll() { return this.userService.findAll(); @@ -27,11 +33,6 @@ export class UserController { return this.userService.findOne(Number(id)); } - @Get(':email/:passWord') - async logIn(@Param('email') email: string, @Param('passWord') passWord: string): Promise { - return await this.authService.signIn(email, passWord); - } - @Patch(':id') update(@Param('id') id: string, @Body() updateUserDto: UpdateUserDto) { return this.userService.update(Number(id), updateUserDto);