mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-26 08:54:54 +00:00
Remove USER role
This commit is contained in:
@ -4,13 +4,12 @@ import {
|
||||
Get,
|
||||
HttpException,
|
||||
HttpStatus,
|
||||
Param,
|
||||
Put,
|
||||
Post,
|
||||
UseGuards,
|
||||
} from '@nestjs/common';
|
||||
import { ApiBearerAuth, ApiTags } from '@nestjs/swagger';
|
||||
import { RoleService } from '../services/role.service';
|
||||
import { UserRoleEditDto } from '../dtos';
|
||||
import { AddUserRoleDto } from '../dtos';
|
||||
import { SuperAdminRoleGuard } from 'src/guards/super.admin.role.guard';
|
||||
|
||||
@ApiTags('Role Module')
|
||||
@ -37,16 +36,13 @@ export class RoleController {
|
||||
}
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(SuperAdminRoleGuard)
|
||||
@Put('edit/user/:userUuid')
|
||||
async editUserRoleType(
|
||||
@Param('userUuid') userUuid: string,
|
||||
@Body() userRoleEditDto: UserRoleEditDto,
|
||||
) {
|
||||
@Post()
|
||||
async addUserRoleType(@Body() addUserRoleDto: AddUserRoleDto) {
|
||||
try {
|
||||
await this.roleService.editUserRoleType(userUuid, userRoleEditDto);
|
||||
await this.roleService.addUserRoleType(addUserRoleDto);
|
||||
return {
|
||||
statusCode: HttpStatus.OK,
|
||||
message: 'User Role Updated Successfully',
|
||||
message: 'User Role Added Successfully',
|
||||
};
|
||||
} catch (error) {
|
||||
throw new HttpException(
|
||||
|
||||
Reference in New Issue
Block a user