fix complaint

This commit is contained in:
Swift
2024-02-24 18:59:06 +03:30
parent 9bf686bbfe
commit d8d95b6069
3 changed files with 19 additions and 2 deletions
+4 -2
View File
@@ -16,11 +16,12 @@ module.exports.create = [
body('receptionCode').notEmpty().withMessage(_faSr.required.field),
body('caption').notEmpty().withMessage(_faSr.required.caption),
body('callType').notEmpty().isBoolean().withMessage(_faSr.required.field),
body('brand').notEmpty().isBoolean().withMessage(_faSr.required.field),
],
checkValidations(validationResult),
async(req, res) => {
const { fullName, national, phoneNumber, deviceNumber, email, receptionCode, caption, callType } = req.body
const { fullName, national, phoneNumber, deviceNumber, email, receptionCode, caption, callType, brand } = req.body
const complaint = await Complaint.create({
fullName,
@@ -31,7 +32,8 @@ module.exports.create = [
callType,
email,
receptionCode,
caption
caption,
brand
})
res.status(201).json(complaint)