FIX: createPermission and updatePermission logics

This commit is contained in:
MohammadHMazarei
2024-12-24 21:18:33 +03:30
parent ee4458d5dd
commit e02b567c16
@@ -14,10 +14,7 @@ exports.getAllPermissions = catchAsync(async (req, res, next) => {
}) })
exports.createPermission = catchAsync(async (req, res, next) => { exports.createPermission = catchAsync(async (req, res, next) => {
const permission = await permissionService.createPermission( const permission = await permissionService.createPermission(req.body)
req.body.englishName,
req.body.persianName
)
res.status(201).json({ res.status(201).json({
status: 'success', status: 'success',
@@ -35,10 +32,10 @@ exports.getPermission = catchAsync(async (req, res, next) => {
}) })
exports.updatePermission = 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({ res.status(200).json({
status: 'success', status: 'success',
data: permission, data: updatePermission,
}) })
}) })