1
0
mirror of https://github.com/sasjs/server.git synced 2025-12-10 11:24:35 +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 permission = await Permission.findOne({ id })
const permission = await Permission.findOne({ permissionId: id })
if (!permission)
throw {
code: 404,
status: 'Not Found',
message: 'Permission not found.'
}
await Permission.deleteOne({ id })
await Permission.deleteOne({ permissionId: id })
}