fix
This commit is contained in:
@@ -409,8 +409,6 @@ module.exports.updateUserByAdmin = [
|
|||||||
})
|
})
|
||||||
}),
|
}),
|
||||||
|
|
||||||
body('shopName').optional().notEmpty().withMessage(_faSr.required.address),
|
|
||||||
|
|
||||||
body('mobile_number')
|
body('mobile_number')
|
||||||
.optional()
|
.optional()
|
||||||
.notEmpty()
|
.notEmpty()
|
||||||
@@ -431,9 +429,37 @@ module.exports.updateUserByAdmin = [
|
|||||||
})
|
})
|
||||||
}),
|
}),
|
||||||
|
|
||||||
body('cell_number').optional().notEmpty().withMessage(_faSr.required.phone_number).bail(),
|
body('shopName')
|
||||||
body('birthDate').optional().notEmpty().withMessage(_faSr.required.birthdate).bail(),
|
.optional()
|
||||||
body('address').optional().notEmpty().withMessage(_faSr.required.address).bail()
|
.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),
|
checkValidations(validationResult),
|
||||||
async (req, res) => {
|
async (req, res) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user