Issue fixed in change-password api
This commit is contained in:
parent
36aff2dc4c
commit
a68ca45abc
@ -227,7 +227,7 @@ exports.changeUserPassword = async (req, res) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Find user
|
// Find user
|
||||||
const user = await EstablishmentUser.findByPk(userId);
|
const user = await EstablishmentUser.scope("withSensitive").findByPk(userId);
|
||||||
if (!user) {
|
if (!user) {
|
||||||
return res.status(404).send({
|
return res.status(404).send({
|
||||||
status: "failed",
|
status: "failed",
|
||||||
|
|||||||
@ -137,7 +137,7 @@ exports.changeAdminUserPassword = async (req, res) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Find user
|
// Find user
|
||||||
const user = await User.findByPk(userId);
|
const user = await User.scope("withSensitive").findByPk(userId);
|
||||||
if (!user) {
|
if (!user) {
|
||||||
return res.status(404).send({ status: "failed", message: "User not found" });
|
return res.status(404).send({ status: "failed", message: "User not found" });
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user