fix
This commit is contained in:
@@ -13,7 +13,6 @@ module.exports.create = [
|
|||||||
body('national').notEmpty().withMessage(_faSr.required.national_code),
|
body('national').notEmpty().withMessage(_faSr.required.national_code),
|
||||||
body('phoneNumber').notEmpty().isMobilePhone().withMessage(_faSr.required.phone_number),
|
body('phoneNumber').notEmpty().isMobilePhone().withMessage(_faSr.required.phone_number),
|
||||||
body('email').notEmpty().isEmail().withMessage(_faSr.required.email),
|
body('email').notEmpty().isEmail().withMessage(_faSr.required.email),
|
||||||
body('deviceNumber').notEmpty().withMessage(_faSr.required.field),
|
|
||||||
body('receptionCode').notEmpty().withMessage(_faSr.required.field),
|
body('receptionCode').notEmpty().withMessage(_faSr.required.field),
|
||||||
body('caption').notEmpty().withMessage(_faSr.required.caption),
|
body('caption').notEmpty().withMessage(_faSr.required.caption),
|
||||||
body('callType').notEmpty().isBoolean().withMessage(_faSr.required.field),
|
body('callType').notEmpty().isBoolean().withMessage(_faSr.required.field),
|
||||||
@@ -50,3 +49,18 @@ module.exports.get = [
|
|||||||
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
module.exports.put = [
|
||||||
|
async(req, res)=>{
|
||||||
|
const { complete } = req.body
|
||||||
|
const complaint = await Complaint.findByIdAndUpdate(
|
||||||
|
req.params.id,
|
||||||
|
{complete},
|
||||||
|
{new:true}
|
||||||
|
)
|
||||||
|
|
||||||
|
res.status(200).json(complaint)
|
||||||
|
|
||||||
|
}
|
||||||
|
]
|
||||||
@@ -106,5 +106,9 @@ module.exports = [
|
|||||||
{
|
{
|
||||||
name: 'شکایت ها',
|
name: 'شکایت ها',
|
||||||
value: 'complaint'
|
value: 'complaint'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'تایید پیگیریه شکایت',
|
||||||
|
value: 'applay'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ const complaintController = require('../controllers/complaintController')
|
|||||||
/// ///////////// Complaint
|
/// ///////////// Complaint
|
||||||
router.get('/complaint',hasPermission('complaint'), complaintController.gets)
|
router.get('/complaint',hasPermission('complaint'), complaintController.gets)
|
||||||
router.get('/complaint/:id',hasPermission('complaint'), complaintController.get)
|
router.get('/complaint/:id',hasPermission('complaint'), complaintController.get)
|
||||||
|
router.put('/complaint/:id',hasPermission('complaint'), complaintController.put)
|
||||||
|
|
||||||
/// ///////////// warranty terms
|
/// ///////////// warranty terms
|
||||||
router.post('/warranty', hasPermission('warranty-terms'), warrantyTermsController.create)
|
router.post('/warranty', hasPermission('warranty-terms'), warrantyTermsController.create)
|
||||||
|
|||||||
Reference in New Issue
Block a user