GWM : forget password api changes
This commit is contained in:
parent
679a074da8
commit
010e59811b
@ -1057,16 +1057,17 @@ exports.forgotPasswordRequestOTP = async (req, res) => {
|
||||
{
|
||||
|
||||
// Validate inputs
|
||||
if (!establishment_name || !establishment_code || !registered_email)
|
||||
return res.status(400).json({ status: "failed", message: "All fields are required" });
|
||||
// if (!establishment_name || !establishment_code || !registered_email)
|
||||
// return res.status(400).json({ status: "failed", message: "All fields are required" });
|
||||
|
||||
// Find establishment and user
|
||||
const establishment = await Establishment.findOne({ where: { establishment_code } });
|
||||
if (!establishment)
|
||||
return res.status(404).json({ status: "failed", message: "Establishment not found" });
|
||||
// // Find establishment and user
|
||||
// const establishment = await Establishment.findOne({ where: { establishment_code } });
|
||||
// if (!establishment)
|
||||
// return res.status(404).json({ status: "failed", message: "Establishment not found" });
|
||||
|
||||
const user = await EstablishmentUser.findOne({
|
||||
where: { email: registered_email, establishment_id: establishment.id },
|
||||
// where: { email: registered_email, establishment_id: establishment.id },
|
||||
where: { email: registered_email },
|
||||
});
|
||||
|
||||
if (!user)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user