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
|
// Validate inputs
|
||||||
if (!establishment_name || !establishment_code || !registered_email)
|
// if (!establishment_name || !establishment_code || !registered_email)
|
||||||
return res.status(400).json({ status: "failed", message: "All fields are required" });
|
// return res.status(400).json({ status: "failed", message: "All fields are required" });
|
||||||
|
|
||||||
// Find establishment and user
|
// // Find establishment and user
|
||||||
const establishment = await Establishment.findOne({ where: { establishment_code } });
|
// const establishment = await Establishment.findOne({ where: { establishment_code } });
|
||||||
if (!establishment)
|
// if (!establishment)
|
||||||
return res.status(404).json({ status: "failed", message: "Establishment not found" });
|
// return res.status(404).json({ status: "failed", message: "Establishment not found" });
|
||||||
|
|
||||||
const user = await EstablishmentUser.findOne({
|
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)
|
if (!user)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user