Fixed select error in getUserByEmail
This commit is contained in:
1 parent
bf0f05d589
commit
f5e4aa0b0c
1 file changed
+2
-2
@@ -68,8 +68,8 @@ const getUserByEmail = async (req, res) => {
|
|||||||
try {
|
try {
|
||||||
// Need the password to be able to compare, removed .select()
|
// Need the password to be able to compare, removed .select()
|
||||||
// We can strip the hash before returing the user
|
// We can strip the hash before returing the user
|
||||||
const user = await UserModel.findOne(
|
const user = await UserModel.findOne({ email: req.body.email }).select(
|
||||||
{ email: req.body.email }.select("-profileImage")
|
"-profileImage"
|
||||||
);
|
);
|
||||||
if (user) {
|
if (user) {
|
||||||
return user;
|
return user;
|
||||||
|
|||||||
Reference in new issue
Block a user