zonedata get api

This commit is contained in:
2025-03-26 18:05:13 +05:30
parent 679f16244f
commit b117c8705c
3 changed files with 16 additions and 1 deletions

View File

@@ -71,4 +71,18 @@ export class zone {
res.status(500).json({ message: 'Zone not found', error })
}
}
static async ZoneData(req: Request, res: Response): Promise<any> {
try {
const organization = req.params.organization;
const zoneID = req.params.zoneID;
const findZone = await zoneModel(organization)
.findOne({ zoneId: zoneID })
// .select("zoneName");
console.log("findZone: ", findZone);
if (findZone) return res.status(200).json(findZone);
} catch (error: any) {
return res.status(500).send(error.message);
}
}
}