Fix reloading the task list after changing a filter
This commit is contained in:
parent
62bfbcce79
commit
d441751c5b
1 changed files with 10 additions and 9 deletions
|
@ -1,4 +1,5 @@
|
||||||
import TaskCollectionService from '../../../services/taskCollection'
|
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.
|
* This mixin provides a base set of methods and properties to get tasks on a list.
|
||||||
|
@ -55,6 +56,14 @@ export default {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (params === null) {
|
||||||
|
params = this.params
|
||||||
|
}
|
||||||
|
|
||||||
|
if (search !== '') {
|
||||||
|
params.s = search
|
||||||
|
}
|
||||||
|
|
||||||
const list = {listId: parseInt(this.$route.params.listId)}
|
const list = {listId: parseInt(this.$route.params.listId)}
|
||||||
|
|
||||||
const currentList = {
|
const currentList = {
|
||||||
|
@ -68,14 +77,6 @@ export default {
|
||||||
|
|
||||||
this.$set(this, 'tasks', [])
|
this.$set(this, 'tasks', [])
|
||||||
|
|
||||||
if (params === null) {
|
|
||||||
params = this.params
|
|
||||||
}
|
|
||||||
|
|
||||||
if (search !== '') {
|
|
||||||
params.s = search
|
|
||||||
}
|
|
||||||
|
|
||||||
this.taskCollectionService.getAll(list, params, page)
|
this.taskCollectionService.getAll(list, params, page)
|
||||||
.then(r => {
|
.then(r => {
|
||||||
this.$set(this, 'tasks', r)
|
this.$set(this, 'tasks', r)
|
||||||
|
@ -110,7 +111,7 @@ export default {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
this.loadedList = currentList
|
this.loadedList = cloneDeep(currentList)
|
||||||
})
|
})
|
||||||
.catch(e => {
|
.catch(e => {
|
||||||
this.error(e, this)
|
this.error(e, this)
|
||||||
|
|
Loading…
Reference in a new issue