Fix listId not changing when switching between lists
This commit is contained in:
parent
5009308c52
commit
010da8cf07
2 changed files with 6 additions and 10 deletions
|
@ -214,9 +214,6 @@
|
||||||
buckets: [],
|
buckets: [],
|
||||||
taskService: TaskService,
|
taskService: TaskService,
|
||||||
|
|
||||||
// We're directly using the list id from the route since that one is always available
|
|
||||||
listId: this.$route.params.listId,
|
|
||||||
|
|
||||||
dropPlaceholderOptions: {
|
dropPlaceholderOptions: {
|
||||||
className: 'drop-preview',
|
className: 'drop-preview',
|
||||||
animationDuration: 150,
|
animationDuration: 150,
|
||||||
|
@ -245,7 +242,7 @@
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
loadBuckets() {
|
loadBuckets() {
|
||||||
this.bucketService.getAll({listId: this.listId})
|
this.bucketService.getAll({listId: this.$route.params.listId})
|
||||||
.then(r => {
|
.then(r => {
|
||||||
this.buckets = r
|
this.buckets = r
|
||||||
})
|
})
|
||||||
|
@ -358,7 +355,7 @@
|
||||||
|
|
||||||
const bi = bucketIndex()
|
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)
|
this.taskService.create(task)
|
||||||
.then(r => {
|
.then(r => {
|
||||||
|
@ -375,7 +372,7 @@
|
||||||
return
|
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)
|
this.bucketService.create(newBucket)
|
||||||
.then(r => {
|
.then(r => {
|
||||||
|
@ -403,7 +400,7 @@
|
||||||
deleteBucket() {
|
deleteBucket() {
|
||||||
const bucket = new BucketModel({
|
const bucket = new BucketModel({
|
||||||
id: this.bucketToDelete,
|
id: this.bucketToDelete,
|
||||||
listId: this.listId,
|
listId: this.$route.params.listId,
|
||||||
})
|
})
|
||||||
this.bucketService.delete(bucket)
|
this.bucketService.delete(bucket)
|
||||||
.then(r => {
|
.then(r => {
|
||||||
|
@ -422,7 +419,7 @@
|
||||||
const bucket = new BucketModel({
|
const bucket = new BucketModel({
|
||||||
id: bucketId,
|
id: bucketId,
|
||||||
title: bucketTitle,
|
title: bucketTitle,
|
||||||
listId: Number(this.listId),
|
listId: Number(this.$route.params.listId),
|
||||||
})
|
})
|
||||||
|
|
||||||
// Because the contenteditable does not have a change event,
|
// Because the contenteditable does not have a change event,
|
||||||
|
|
|
@ -118,7 +118,6 @@
|
||||||
name: 'List',
|
name: 'List',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
listId: this.$route.params.listId,
|
|
||||||
taskService: TaskService,
|
taskService: TaskService,
|
||||||
list: {},
|
list: {},
|
||||||
isTaskEdit: false,
|
isTaskEdit: false,
|
||||||
|
@ -152,7 +151,7 @@
|
||||||
}
|
}
|
||||||
this.showError = false
|
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)
|
this.taskService.create(task)
|
||||||
.then(r => {
|
.then(r => {
|
||||||
this.tasks.push(r)
|
this.tasks.push(r)
|
||||||
|
|
Loading…
Add table
Reference in a new issue