29 lines
942 B
JavaScript
29 lines
942 B
JavaScript
|
|
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
|
|
|
|
}
|
|
]
|