Skip to content

Commit

Permalink
ugyeskedes
Browse files Browse the repository at this point in the history
  • Loading branch information
RVSE-Kuffe committed Sep 6, 2024
1 parent f6d796a commit 2a8877b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions apps/backend/src/user/user.controller.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -17,6 +18,11 @@ export class UserController {
return this.userService.create(createUserDto);
}

@Post('login')
async logIn(@Body() loginDto: { email: string; passWord: string }): Promise<User> {
return await this.authService.signIn(loginDto.email, loginDto.passWord);
}

@Get()
findAll() {
return this.userService.findAll();
Expand All @@ -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<any> {
return await this.authService.signIn(email, passWord);
}

@Patch(':id')
update(@Param('id') id: string, @Body() updateUserDto: UpdateUserDto) {
return this.userService.update(Number(id), updateUserDto);
Expand Down

0 comments on commit 2a8877b

Please sign in to comment.