mirror of
https://github.com/sasjs/server.git
synced 2025-12-11 19:44:35 +00:00
fix: controller fixed for deleting permission
This commit is contained in:
@@ -320,12 +320,12 @@ const updatePermission = async (
|
|||||||
}
|
}
|
||||||
|
|
||||||
const deletePermission = async (id: number) => {
|
const deletePermission = async (id: number) => {
|
||||||
const permission = await Permission.findOne({ id })
|
const permission = await Permission.findOne({ permissionId: id })
|
||||||
if (!permission)
|
if (!permission)
|
||||||
throw {
|
throw {
|
||||||
code: 404,
|
code: 404,
|
||||||
status: 'Not Found',
|
status: 'Not Found',
|
||||||
message: 'Permission not found.'
|
message: 'Permission not found.'
|
||||||
}
|
}
|
||||||
await Permission.deleteOne({ id })
|
await Permission.deleteOne({ permissionId: id })
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user