diff --git a/components/permission/permissionController.js b/components/permission/permissionController.js index a8ef0e6..7f2ae4b 100644 --- a/components/permission/permissionController.js +++ b/components/permission/permissionController.js @@ -14,10 +14,7 @@ exports.getAllPermissions = catchAsync(async (req, res, next) => { }) exports.createPermission = catchAsync(async (req, res, next) => { - const permission = await permissionService.createPermission( - req.body.englishName, - req.body.persianName - ) + const permission = await permissionService.createPermission(req.body) res.status(201).json({ status: 'success', @@ -35,10 +32,10 @@ exports.getPermission = catchAsync(async (req, res, next) => { }) exports.updatePermission = catchAsync(async (req, res, next) => { - const updatePermission = await permissionService.updatePermission(data) + const updatePermission = await permissionService.updatePermission(req.params.id, req.body) res.status(200).json({ status: 'success', - data: permission, + data: updatePermission, }) })