City/Town validation added to create establishment API
This commit is contained in:
parent
924e428939
commit
27acb26590
@ -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) {
|
if (!Array.isArray(establishment_products) || establishment_products.length === 0) {
|
||||||
return res.status(400).send({
|
return res.status(400).send({
|
||||||
status: "failed",
|
status: "failed",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user