Skip to content
This repository was archived by the owner on Jun 27, 2019. It is now read-only.

Commit 65f907d

Browse files
committed
Fix #171
1 parent e3ebd58 commit 65f907d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

server/hooks/exclude-blacklisted.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,12 @@ module.exports = function excludeBlacklisted() {
1313
if (usersettings.total <= 0){
1414
return hook;
1515
}
16-
const blacklist = usersettings.data[0].blacklist;
17-
hook.params.query.userId = {$nin: blacklist};
16+
const { blacklist } = usersettings.data[0];
17+
if (blacklist) {
18+
let { query } = hook.params;
19+
query.userId = query.userId || {};
20+
query.userId.$nin = blacklist;
21+
}
1822
return hook;
1923
}
2024

0 commit comments

Comments
 (0)