Skip to content

Commit

Permalink
Step 13.1: Create UninvitedFilter
Browse files Browse the repository at this point in the history
  • Loading branch information
Kamil Kisiela authored and Dotan Simha committed Nov 22, 2016
1 parent 8985c2b commit 39a48ee
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions imports/ui/filters/uninvitedFilter.js
@@ -0,0 +1,20 @@
import angular from 'angular';

const name = 'uninvitedFilter';

function UninvitedFilter(users, party) {
if (!party) {
return false;
}

return users.filter((user) => {
// if not the owner and not invited
return user._id !== party.owner && (party.invited || []).indexOf(user._id) === -1;
});
}

// create a module
export default angular.module(name, [])
.filter(name, () => {
return UninvitedFilter;
});

0 comments on commit 39a48ee

Please sign in to comment.