mirror of
https://github.com/dadosfera/maestro.git
synced 2026-10-25 16:39:08 +00:00
FEAT: User Management WIP
This commit is contained in:
@@ -4,6 +4,8 @@ import {
|
||||
Delete,
|
||||
Get,
|
||||
Inject,
|
||||
Param,
|
||||
Post,
|
||||
Put,
|
||||
Query,
|
||||
} from '@nestjs/common';
|
||||
@@ -12,6 +14,9 @@ import { DadosferaLogger } from 'dadosfera-logs';
|
||||
import { RequestUser, User } from 'src/authentication/user.decorator';
|
||||
import {
|
||||
AssignRoleToUserReq,
|
||||
CreateUserReq,
|
||||
CreateUserRes,
|
||||
DeleteUserRes,
|
||||
GetAllUsersByCustomerIdReq,
|
||||
GetAllUsersByCustomerIdRes,
|
||||
UnassignRoleToUserReq,
|
||||
@@ -31,6 +36,19 @@ export class UsersController {
|
||||
this.logger = dadosferaLogger.logger;
|
||||
}
|
||||
|
||||
@Post()
|
||||
@ApiOkResponse({ type: CreateUserRes })
|
||||
async createUser(@User() user, @Body() body: CreateUserReq) {
|
||||
console.log(body);
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
@ApiOkResponse({ type: DeleteUserRes })
|
||||
async deleteUser(@User() user, @Param('id') id: string) {
|
||||
this.logger.info('deleteUser', { user });
|
||||
return await this.userService.deleteUser({ id });
|
||||
}
|
||||
|
||||
@Get()
|
||||
@ApiOkResponse({
|
||||
type: GetAllUsersByCustomerIdRes,
|
||||
|
||||
Reference in New Issue
Block a user