Merge branch 'master' of bitbucket.org:jubilian/fcsc_ipi_backend

This commit is contained in:
Gowtham M 2025-12-19 17:38:12 +05:30
commit 67ec8f6214

View File

@ -139,6 +139,16 @@ exports.createEstablishment = async (req, res) => {
if (existingEstablishment) {
return res.status(400).send({status: "failed",message: "Establishment code already exists", });
}
const existingUser = await EstablishmentUser.findOne({
where: { email: establishment_user.email }
});
if (existingUser) {
return res.status(400).send({
status: "failed",
message: "User email already exists"
});
}
// Create establishment record
const establishment = await Establishment.create({