Initial refactor
This commit is contained in:
1 parent
bf0f05d589
commit
7b04fcb9fe
6 files changed
+199
-27
No files matched your search
@@ -68,8 +68,8 @@ const getUserByEmail = async (req, res) => {
|
||||
try {
|
||||
// Need the password to be able to compare, removed .select()
|
||||
// We can strip the hash before returing the user
|
||||
const user = await UserModel.findOne(
|
||||
{ email: req.body.email }.select("-profileImage")
|
||||
const user = await UserModel.findOne({ email: req.body.email }).select(
|
||||
"-profileImage"
|
||||
);
|
||||
if (user) {
|
||||
return user;
|
||||
|
||||
Reference in new issue
Block a user