diff --git a/pages/complaint/index.vue b/pages/complaint/index.vue index 7584316..02bfab2 100644 --- a/pages/complaint/index.vue +++ b/pages/complaint/index.vue @@ -190,6 +190,19 @@ +
+
انتخاب نوع کالا:
+ + +
+
ارسال
@@ -213,6 +226,7 @@ export default { receptionCode: null, caption: null, callType: true, + brand:true }, validation: {}, hasValidationError: false, diff --git a/server/controllers/complaintController.js b/server/controllers/complaintController.js index 64a76fc..1402c47 100644 --- a/server/controllers/complaintController.js +++ b/server/controllers/complaintController.js @@ -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) diff --git a/server/models/Complaint.js b/server/models/Complaint.js index 576fd55..7f07375 100644 --- a/server/models/Complaint.js +++ b/server/models/Complaint.js @@ -12,6 +12,7 @@ const ComplaintSchema = mongoose.Schema({ receptionCode: String, caption: String, callType: Boolean, + brand: Boolean, type:{ type:Number, default:0