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
+14
View File
@@ -190,6 +190,19 @@
</el-switch>
</div>
<div class="col-lg-4 col-sm-12 mt-4">
<h5 class="mb-2">انتخاب نوع کالا:</h5>
<el-switch
v-model="form.brand"
inactive-color="#03fc3d"
active-color="#0367fc"
style="display: flex; justify-content: space-evenly"
active-text="پاناتک"
inactive-text="وریتی"
>
</el-switch>
</div>
<div class="col-lg-12 col-sm-12 mt-4 d-flex" style="justify-content: center">
<el-button type="primary" @click="sendForm" round>ارسال</el-button>
</div>
@@ -213,6 +226,7 @@ export default {
receptionCode: null,
caption: null,
callType: true,
brand:true
},
validation: {},
hasValidationError: false,
+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)
+1
View File
@@ -12,6 +12,7 @@ const ComplaintSchema = mongoose.Schema({
receptionCode: String,
caption: String,
callType: Boolean,
brand: Boolean,
type:{
type:Number,
default:0