add: columns / field email in contact
This commit is contained in:
@@ -25,6 +25,7 @@ const getAllContactDb = async (searchParams = {}) => {
|
||||
{ column: "a.contact_name", param: searchParams.name, type: "string" },
|
||||
{ column: "a.contact_type", param: searchParams.code, type: "string" },
|
||||
{ column: "a.is_active", param: searchParams.active, type: "boolean" },
|
||||
{ column: "a.email", param: searchParams.email, type: "string" },
|
||||
],
|
||||
queryParams
|
||||
);
|
||||
|
||||
@@ -13,7 +13,8 @@ const insertContactSchema = Joi.object({
|
||||
"Phone number must be a valid Indonesian number in format +628XXXXXXXXX",
|
||||
}),
|
||||
is_active: Joi.boolean().required(),
|
||||
contact_type: Joi.string().max(255).optional().allow(null)
|
||||
contact_type: Joi.string().max(255).optional().allow(null),
|
||||
email: Joi.string().email().optional()
|
||||
});
|
||||
|
||||
const updateContactSchema = Joi.object({
|
||||
@@ -26,7 +27,8 @@ const updateContactSchema = Joi.object({
|
||||
"Phone number must be a valid Indonesian number in format +628XXXXXXXXX",
|
||||
}),
|
||||
is_active: Joi.boolean().optional(),
|
||||
contact_type: Joi.string().max(255).optional().allow(null)
|
||||
contact_type: Joi.string().max(255).optional().allow(null),
|
||||
email: Joi.string().email().required()
|
||||
});
|
||||
|
||||
module.exports = {
|
||||
|
||||
Reference in New Issue
Block a user