Filtering for tasks

This commit is contained in:
baldo 2016-06-07 12:45:23 +02:00
parent 122eadc0de
commit 5b9d2e615b
3 changed files with 20 additions and 2 deletions
server/resources

View file

@ -84,9 +84,14 @@ angular.module('ffffng').factory('TaskResource', function (
['id', 'name', 'schedule', 'state', 'runningSince', 'lastRunStarted'],
restParams
);
var total = tasks.length;
var filteredTasks = Resources.filter(
tasks,
['id', 'name', 'schedule', 'state'],
restParams
);
var total = filteredTasks.length;
var pageTasks = Resources.getPageEntities(tasks, restParams);
var pageTasks = Resources.getPageEntities(filteredTasks, restParams);
res.set('X-Total-Count', total);
return Resources.success(res, _.map(pageTasks, toExternalTask));