Skip to content

Commit

Permalink
Merge pull request #409 from ushahidi/hotfix/search-pagination-not-wo…
Browse files Browse the repository at this point in the history
…rking

Handle filtering posts to 'all' statuses better
  • Loading branch information
rjmackay committed Nov 8, 2016
2 parents 2586759 + 4d43939 commit f1af32a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/main/posts/views/post-filters.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ function PostFiltersService(_, FormEndpoint) {
}

function setFilters(newState) {
// Replace 'all' with full list of statuses
// Gives less confusing active display, and works around API bug
if (newState.status === 'all') {
newState.status = ['published', 'draft', 'archived'];
}

// Replace filterState with defaults + newState
// Including defaults ensures all values are always defined
return angular.merge(filterState, getDefaults(), newState);
Expand Down

0 comments on commit f1af32a

Please sign in to comment.