1
0
mirror of https://github.com/sasjs/server.git synced 2025-12-12 03:54:34 +00:00

fix: controller fixed for deleting permission

This commit is contained in:
2022-07-04 04:27:58 +05:00
parent e516b7716d
commit b5f595a25c

View File

@@ -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 })
} }