feat: write REST API endpoint to delete role

This commit is contained in:
Ali BARIN
2024-09-05 15:31:24 +00:00
parent ea667bb6a9
commit 0b6c28422c
4 changed files with 187 additions and 0 deletions

View File

@@ -6,6 +6,7 @@ import createRoleAction from '../../../../controllers/api/v1/admin/roles/create-
import getRolesAction from '../../../../controllers/api/v1/admin/roles/get-roles.ee.js';
import getRoleAction from '../../../../controllers/api/v1/admin/roles/get-role.ee.js';
import updateRoleAction from '../../../../controllers/api/v1/admin/roles/update-role.ee.js';
import deleteRoleAction from '../../../../controllers/api/v1/admin/roles/delete-role.ee.js';
const router = Router();
@@ -41,4 +42,12 @@ router.patch(
updateRoleAction
);
router.delete(
'/:roleId',
authenticateUser,
authorizeAdmin,
checkIsEnterprise,
deleteRoleAction
);
export default router;