mirror of
https://github.com/swissmakers/swiss-datashare.git
synced 2026-04-15 03:43:14 +02:00
fix: dto returns
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user