add: columns / field email in contact

This commit is contained in:
Muhammad Afif
2026-06-05 13:42:30 +07:00
parent 40de826da9
commit ab5fe3e9c4
2 changed files with 5 additions and 2 deletions

View File

@@ -25,6 +25,7 @@ const getAllContactDb = async (searchParams = {}) => {
{ column: "a.contact_name", param: searchParams.name, type: "string" }, { column: "a.contact_name", param: searchParams.name, type: "string" },
{ column: "a.contact_type", param: searchParams.code, type: "string" }, { column: "a.contact_type", param: searchParams.code, type: "string" },
{ column: "a.is_active", param: searchParams.active, type: "boolean" }, { column: "a.is_active", param: searchParams.active, type: "boolean" },
{ column: "a.email", param: searchParams.email, type: "string" },
], ],
queryParams queryParams
); );

View File

@@ -13,7 +13,8 @@ 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).optional().allow(null) contact_type: Joi.string().max(255).optional().allow(null),
email: Joi.string().email().optional()
}); });
const updateContactSchema = Joi.object({ const updateContactSchema = Joi.object({
@@ -26,7 +27,8 @@ const updateContactSchema = 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().optional(), 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 = { module.exports = {