Remove USER role

This commit is contained in:
faris Aljohari
2024-05-18 23:00:22 +03:00
parent 1bc8fee061
commit 6415d78992
23 changed files with 107 additions and 136 deletions

View File

@ -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(