fix
This commit is contained in:
@@ -409,8 +409,6 @@ module.exports.updateUserByAdmin = [
|
||||
})
|
||||
}),
|
||||
|
||||
body('shopName').optional().notEmpty().withMessage(_faSr.required.address),
|
||||
|
||||
body('mobile_number')
|
||||
.optional()
|
||||
.notEmpty()
|
||||
@@ -431,9 +429,37 @@ module.exports.updateUserByAdmin = [
|
||||
})
|
||||
}),
|
||||
|
||||
body('cell_number').optional().notEmpty().withMessage(_faSr.required.phone_number).bail(),
|
||||
body('birthDate').optional().notEmpty().withMessage(_faSr.required.birthdate).bail(),
|
||||
body('address').optional().notEmpty().withMessage(_faSr.required.address).bail()
|
||||
body('shopName')
|
||||
.optional()
|
||||
.custom((value, { req }) => {
|
||||
if (value === '') return true
|
||||
return value ? true : Promise.reject(_faSr.required.shop_name)
|
||||
})
|
||||
.bail(),
|
||||
|
||||
body('cell_number')
|
||||
.optional()
|
||||
.custom((value, { req }) => {
|
||||
if (value === '') return true
|
||||
return value ? true : Promise.reject(_faSr.required.phone_number)
|
||||
})
|
||||
.bail(),
|
||||
|
||||
body('birthDate')
|
||||
.optional()
|
||||
.custom((value, { req }) => {
|
||||
if (value === '') return true
|
||||
return value ? true : Promise.reject(_faSr.required.birthdate)
|
||||
})
|
||||
.bail(),
|
||||
|
||||
body('address')
|
||||
.optional()
|
||||
.custom((value, { req }) => {
|
||||
if (value === '') return true
|
||||
return value ? true : Promise.reject(_faSr.required.address)
|
||||
})
|
||||
.bail()
|
||||
],
|
||||
checkValidations(validationResult),
|
||||
async (req, res) => {
|
||||
|
||||
Reference in New Issue
Block a user