refactor(server): user info endpoint (#9668)

* refactor(server): user info endpoint

* chore: open api
This commit is contained in:
Jason Rasmussen 2024-05-22 14:15:33 -04:00 committed by GitHub
parent 202745f14b
commit ecd018a826
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 64 additions and 66 deletions

View file

@ -41,10 +41,10 @@ export class UserController {
return this.service.getAll(auth, isAll);
}
@Get('info/:id')
@Authenticated()
getUserById(@Param() { id }: UUIDParamDto): Promise<UserResponseDto> {
return this.service.get(id);
@Post()
@Authenticated({ admin: true })
createUser(@Body() createUserDto: CreateUserDto): Promise<UserResponseDto> {
return this.service.create(createUserDto);
}
@Get('me')
@ -53,10 +53,10 @@ export class UserController {
return this.service.getMe(auth);
}
@Post()
@Authenticated({ admin: true })
createUser(@Body() createUserDto: CreateUserDto): Promise<UserResponseDto> {
return this.service.create(createUserDto);
@Get(':id')
@Authenticated()
getUserById(@Param() { id }: UUIDParamDto): Promise<UserResponseDto> {
return this.service.get(id);
}
@Delete('profile-image')