Fix reloading the task list after changing a filter

This commit is contained in:
kolaente 2021-02-20 16:43:39 +01:00
parent 62bfbcce79
commit d441751c5b
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 10 additions and 9 deletions

View File

@ -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)