Fix
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
|
||||
const { body, validationResult } = require('express-validator')
|
||||
|
||||
const Complaint = require('../models/Complaint')
|
||||
const { _sr } = require('../plugins/serverResponses')
|
||||
const { checkValidations } = require('../plugins/controllersHelperFunctions')
|
||||
const _faSr = _sr.fa
|
||||
|
||||
|
||||
module.exports.create = [
|
||||
[
|
||||
body('fullName').notEmpty().withMessage(_faSr.required.name),
|
||||
body('national').notEmpty().withMessage(_faSr.required.national_code),
|
||||
body('phoneNumber').notEmpty().withMessage(_faSr.required.phone_number),
|
||||
body('email').notEmpty().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().withMessage(_faSr.required.field),
|
||||
|
||||
],
|
||||
checkValidations(validationResult),
|
||||
(req, res) => {
|
||||
|
||||
const
|
||||
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
const mongoose = require('mongoose')
|
||||
|
||||
|
||||
|
||||
const ComplaintSchema = mongoose.Schema({
|
||||
|
||||
fullName: String,
|
||||
national: Number,
|
||||
phoneNumber: Number,
|
||||
deviceNumber: String,
|
||||
email: String,
|
||||
receptionCode: String,
|
||||
caption: String,
|
||||
callType: Boolean
|
||||
|
||||
})
|
||||
|
||||
|
||||
module.exports = mongoose.model('Complaint', ComplaintSchema)
|
||||
@@ -102,5 +102,9 @@ module.exports = [
|
||||
{
|
||||
name: 'نظر سنجی',
|
||||
value: 'surveys'
|
||||
},
|
||||
{
|
||||
name: 'شکایت ها',
|
||||
value: 'complaint'
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user