fix: dto returns

This commit is contained in:
Elias Schneider
2022-10-10 17:58:42 +02:00
parent 4bab33ad8a
commit 02beb66910
9 changed files with 20 additions and 17 deletions

View File

@@ -2,12 +2,13 @@ import { Controller, Get, UseGuards } from "@nestjs/common";
import { User } from "@prisma/client";
import { GetUser } from "src/auth/decorator/getUser.decorator";
import { JwtGuard } from "src/auth/guard/jwt.guard";
import { UserDTO } from "./dto/user.dto";
@Controller("users")
export class UserController {
@Get("me")
@UseGuards(JwtGuard)
async getCurrentUser(@GetUser() user: User) {
return user;
return new UserDTO().from(user);
}
}