fix complaint
This commit is contained in:
@@ -190,6 +190,19 @@
|
|||||||
</el-switch>
|
</el-switch>
|
||||||
</div>
|
</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">
|
<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>
|
<el-button type="primary" @click="sendForm" round>ارسال</el-button>
|
||||||
</div>
|
</div>
|
||||||
@@ -213,6 +226,7 @@ export default {
|
|||||||
receptionCode: null,
|
receptionCode: null,
|
||||||
caption: null,
|
caption: null,
|
||||||
callType: true,
|
callType: true,
|
||||||
|
brand:true
|
||||||
},
|
},
|
||||||
validation: {},
|
validation: {},
|
||||||
hasValidationError: false,
|
hasValidationError: false,
|
||||||
|
|||||||
@@ -16,11 +16,12 @@ module.exports.create = [
|
|||||||
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),
|
||||||
|
body('brand').notEmpty().isBoolean().withMessage(_faSr.required.field),
|
||||||
|
|
||||||
],
|
],
|
||||||
checkValidations(validationResult),
|
checkValidations(validationResult),
|
||||||
async(req, res) => {
|
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({
|
const complaint = await Complaint.create({
|
||||||
fullName,
|
fullName,
|
||||||
@@ -31,7 +32,8 @@ module.exports.create = [
|
|||||||
callType,
|
callType,
|
||||||
email,
|
email,
|
||||||
receptionCode,
|
receptionCode,
|
||||||
caption
|
caption,
|
||||||
|
brand
|
||||||
})
|
})
|
||||||
|
|
||||||
res.status(201).json(complaint)
|
res.status(201).json(complaint)
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ const ComplaintSchema = mongoose.Schema({
|
|||||||
receptionCode: String,
|
receptionCode: String,
|
||||||
caption: String,
|
caption: String,
|
||||||
callType: Boolean,
|
callType: Boolean,
|
||||||
|
brand: Boolean,
|
||||||
type:{
|
type:{
|
||||||
type:Number,
|
type:Number,
|
||||||
default:0
|
default:0
|
||||||
|
|||||||
Reference in New Issue
Block a user