FIX: createPermission and updatePermission logics
This commit is contained in:
@@ -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,
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user