We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b517a98 commit eee48c4Copy full SHA for eee48c4
controllers/blockedUser.js
@@ -10,21 +10,15 @@ exports.checkIfUserBlocked = async (req, res) => {
10
});
11
}
12
13
- const doc = await BlockedUsersFromApp.findOne();
+ const doc = await BlockedUsersFromApp.findOne({email: email});
14
15
if (!doc) {
16
return res.json({ isBlocked: false });
17
18
19
- const user = doc.blockedUsers.find((u) => u.email === email.toLowerCase());
20
-
21
- if (!user) {
22
- return res.json({ isBlocked: false });
23
- }
24
25
return res.json({
26
- isBlocked: user.isPermanent,
27
- reportCount: user.count,
+ isBlocked: doc.isPermanent,
+ reportCount: doc.count,
28
29
} catch (err) {
30
console.error("CHECK BLOCK ERROR:", err);
0 commit comments