From d441751c5b571902ccd2cdab5c135b6e845923ed Mon Sep 17 00:00:00 2001 From: kolaente Date: Sat, 20 Feb 2021 16:43:39 +0100 Subject: [PATCH] Fix reloading the task list after changing a filter --- src/components/tasks/mixins/taskList.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/components/tasks/mixins/taskList.js b/src/components/tasks/mixins/taskList.js index 51c75ba29..faec522e0 100644 --- a/src/components/tasks/mixins/taskList.js +++ b/src/components/tasks/mixins/taskList.js @@ -1,4 +1,5 @@ import TaskCollectionService from '../../../services/taskCollection' +import {cloneDeep} from 'lodash' /** * This mixin provides a base set of methods and properties to get tasks on a list. @@ -55,6 +56,14 @@ export default { return } + if (params === null) { + params = this.params + } + + if (search !== '') { + params.s = search + } + const list = {listId: parseInt(this.$route.params.listId)} const currentList = { @@ -68,14 +77,6 @@ export default { this.$set(this, 'tasks', []) - if (params === null) { - params = this.params - } - - if (search !== '') { - params.s = search - } - this.taskCollectionService.getAll(list, params, page) .then(r => { this.$set(this, 'tasks', r) @@ -110,7 +111,7 @@ export default { }) } - this.loadedList = currentList + this.loadedList = cloneDeep(currentList) }) .catch(e => { this.error(e, this)