repair: change mandatory to opsional
This commit is contained in:
@@ -13,14 +13,14 @@ const insertContactSchema = Joi.object({
|
|||||||
"Phone number must be a valid Indonesian number in format +628XXXXXXXXX",
|
"Phone number must be a valid Indonesian number in format +628XXXXXXXXX",
|
||||||
}),
|
}),
|
||||||
is_active: Joi.boolean().required(),
|
is_active: Joi.boolean().required(),
|
||||||
contact_type: Joi.string().max(255).required()
|
contact_type: Joi.string().max(255).optional()
|
||||||
});
|
});
|
||||||
|
|
||||||
const updateContactSchema = Joi.object({
|
const updateContactSchema = Joi.object({
|
||||||
contact_name: Joi.string().min(3).max(100).required(),
|
contact_name: Joi.string().min(3).max(100).optional(),
|
||||||
contact_phone: Joi.string()
|
contact_phone: Joi.string()
|
||||||
.pattern(/^(?:\+62|0)8\d{7,10}$/)
|
.pattern(/^(?:\+62|0)8\d{7,10}$/)
|
||||||
.required()
|
.optional()
|
||||||
.messages({
|
.messages({
|
||||||
"string.pattern.base":
|
"string.pattern.base":
|
||||||
"Phone number must be a valid Indonesian number in format +628XXXXXXXXX",
|
"Phone number must be a valid Indonesian number in format +628XXXXXXXXX",
|
||||||
|
|||||||
Reference in New Issue
Block a user