From 2270272a8f348073c8ae5bebde4c9a12e821cdc1 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sat, 9 May 2020 15:46:05 +0200 Subject: [PATCH] Fix using filters for overview views --- src/components/tasks/ShowTasks.vue | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/components/tasks/ShowTasks.vue b/src/components/tasks/ShowTasks.vue index a71664dc3..02be4a0b5 100644 --- a/src/components/tasks/ShowTasks.vue +++ b/src/components/tasks/ShowTasks.vue @@ -44,15 +44,26 @@ }, methods: { loadPendingTasks() { - let params = { + const params = { sort_by: ['due_date_unix', 'id'], order_by: ['desc', 'desc'], filter_by: ['done'], filter_value: [false], + filter_comparator: ['equals'], + filter_concat: 'and', } if (!this.showAll) { - params.startdate = Math.round(+ this.startDate / 1000) - params.enddate = Math.round(+ this.endDate / 1000) + params.filter_by.push('start_date') + params.filter_value.push(Math.round(+ this.startDate / 1000)) + params.filter_comparator.push('greater') + + params.filter_by.push('end_date') + params.filter_value.push(Math.round(+ this.endDate / 1000)) + params.filter_comparator.push('less') + + params.filter_by.push('due_date') + params.filter_value.push(Math.round(+ this.endDate / 1000)) + params.filter_comparator.push('less') } this.taskService.getAll({}, params) @@ -64,8 +75,7 @@ } } } - this.$set(this, 'tasks', r) - this.sortTasks() + this.$set(this, 'tasks', r.filter(t => !t.done)) }) .catch(e => { this.error(e, this)