fix
This commit is contained in:
@@ -13,7 +13,6 @@ module.exports.create = [
|
||||
body('national').notEmpty().withMessage(_faSr.required.national_code),
|
||||
body('phoneNumber').notEmpty().isMobilePhone().withMessage(_faSr.required.phone_number),
|
||||
body('email').notEmpty().isEmail().withMessage(_faSr.required.email),
|
||||
body('deviceNumber').notEmpty().withMessage(_faSr.required.field),
|
||||
body('receptionCode').notEmpty().withMessage(_faSr.required.field),
|
||||
body('caption').notEmpty().withMessage(_faSr.required.caption),
|
||||
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: 'شکایت ها',
|
||||
value: 'complaint'
|
||||
},
|
||||
{
|
||||
name: 'تایید پیگیریه شکایت',
|
||||
value: 'applay'
|
||||
}
|
||||
]
|
||||
|
||||
@@ -30,6 +30,7 @@ const complaintController = require('../controllers/complaintController')
|
||||
/// ///////////// Complaint
|
||||
router.get('/complaint',hasPermission('complaint'), complaintController.gets)
|
||||
router.get('/complaint/:id',hasPermission('complaint'), complaintController.get)
|
||||
router.put('/complaint/:id',hasPermission('complaint'), complaintController.put)
|
||||
|
||||
/// ///////////// warranty terms
|
||||
router.post('/warranty', hasPermission('warranty-terms'), warrantyTermsController.create)
|
||||
|
||||
Reference in New Issue
Block a user