Fix listId not changing when switching between lists

This commit is contained in:
kolaente 2020-05-01 11:50:12 +02:00
parent 5009308c52
commit 010da8cf07
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B
2 changed files with 6 additions and 10 deletions

View file

@ -214,9 +214,6 @@
buckets: [],
taskService: TaskService,
// We're directly using the list id from the route since that one is always available
listId: this.$route.params.listId,
dropPlaceholderOptions: {
className: 'drop-preview',
animationDuration: 150,
@ -245,7 +242,7 @@
},
methods: {
loadBuckets() {
this.bucketService.getAll({listId: this.listId})
this.bucketService.getAll({listId: this.$route.params.listId})
.then(r => {
this.buckets = r
})
@ -358,7 +355,7 @@
const bi = bucketIndex()
const task = new TaskModel({text: this.newTaskText, bucketId: this.buckets[bi].id, listId: this.listId})
const task = new TaskModel({text: this.newTaskText, bucketId: this.buckets[bi].id, listId: this.$route.params.listId})
this.taskService.create(task)
.then(r => {
@ -375,7 +372,7 @@
return
}
const newBucket = new BucketModel({title: this.newBucketTitle, listId: parseInt(this.listId)})
const newBucket = new BucketModel({title: this.newBucketTitle, listId: parseInt(this.$route.params.listId)})
this.bucketService.create(newBucket)
.then(r => {
@ -403,7 +400,7 @@
deleteBucket() {
const bucket = new BucketModel({
id: this.bucketToDelete,
listId: this.listId,
listId: this.$route.params.listId,
})
this.bucketService.delete(bucket)
.then(r => {
@ -422,7 +419,7 @@
const bucket = new BucketModel({
id: bucketId,
title: bucketTitle,
listId: Number(this.listId),
listId: Number(this.$route.params.listId),
})
// Because the contenteditable does not have a change event,

View file

@ -118,7 +118,6 @@
name: 'List',
data() {
return {
listId: this.$route.params.listId,
taskService: TaskService,
list: {},
isTaskEdit: false,
@ -152,7 +151,7 @@
}
this.showError = false
let task = new TaskModel({text: this.newTaskText, listId: this.listId})
let task = new TaskModel({text: this.newTaskText, listId: this.$route.params.listId})
this.taskService.create(task)
.then(r => {
this.tasks.push(r)