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

Commit

Permalink
Merge pull request #10 from ethical-jobs/feature/activities-filter-or…
Browse files Browse the repository at this point in the history
…g-fix

trello-bug-212 Fixed bug where filter was not fetching correct subjec…
  • Loading branch information
IgorNadj committed Apr 29, 2019
2 parents 5610ef7 + f903f68 commit 1cea219
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
12 changes: 9 additions & 3 deletions src/activities/__tests__/selectors.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,21 @@ test('filteredActivity can filter by ... filters', () => {
const activities = Immutable.fromJS({
51: {
id: 51,
subject_id: 15,
subject: {
id: 15
},
},
52: {
id: 52,
subject_id: 8,
subject: {
id: 8
},
},
53: {
id: 53,
subject_id: 15,
subject: {
id: 15
},
},
});
const filters = Immutable.fromJS({
Expand Down
4 changes: 2 additions & 2 deletions src/activities/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ export function byOrganisations(activity, organisations) {
return true; // pass through
}
if (Immutable.isCollection(organisations)) {
return organisations.includes(activity.get('subject_id'));
return organisations.includes(activity.getIn(['subject', 'id']));
}
return activity.get('subject_id') === organisations;
return activity.getIn(['subject', 'id']) === organisations;
}

/**
Expand Down

0 comments on commit 1cea219

Please sign in to comment.