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

Commit

Permalink
Fix #171
Browse files Browse the repository at this point in the history
  • Loading branch information
roschaefer committed Oct 9, 2018
1 parent 2f0508b commit 1bb9c57
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions server/hooks/exclude-blacklisted.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ module.exports = function excludeBlacklisted() {
if (usersettings.total <= 0){
return hook;
}
const blacklist = usersettings.data[0].blacklist;
hook.params.query.userId = {$nin: blacklist};
const { blacklist } = usersettings.data[0];
if (blacklist) {
hook.params.query.userId = hook.params.query.userId || {}
hook.params.query.userId.$nin = blacklist
}
return hook;
}

Expand Down

0 comments on commit 1bb9c57

Please sign in to comment.