City/Town validation added to create establishment API

This commit is contained in:
unknown 2025-12-08 19:01:55 +05:30
parent 924e428939
commit 27acb26590

View File

@ -105,6 +105,13 @@ exports.createEstablishment = async (req, res) => {
});
}
if (!establishment_city_town_id || !corporate_city_town_id) {
return res.status(400).send({
status: "failed",
message: "Missing required field: city/town",
});
}
if (!Array.isArray(establishment_products) || establishment_products.length === 0) {
return res.status(400).send({
status: "failed",