Ensure labels of a task get updated when updating them
This commit is contained in:
parent
f690a6f457
commit
aeba5651af
3 changed files with 7 additions and 5 deletions
|
@ -150,7 +150,7 @@
|
||||||
</span>
|
</span>
|
||||||
Labels
|
Labels
|
||||||
</div>
|
</div>
|
||||||
<edit-labels :task-i-d="taskID" :start-labels="task.labels" ref="labels"/>
|
<edit-labels :task-i-d="taskID" v-model="task.labels" ref="labels"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Description -->
|
<!-- Description -->
|
||||||
|
|
|
@ -121,7 +121,7 @@
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label class="label">Labels</label>
|
<label class="label">Labels</label>
|
||||||
<div class="control">
|
<div class="control">
|
||||||
<edit-labels :task-i-d="taskEditTask.id" :start-labels="taskEditTask.labels"/>
|
<edit-labels :task-i-d="taskEditTask.id" v-model="taskEditTask.labels"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
export default {
|
export default {
|
||||||
name: 'edit-labels',
|
name: 'edit-labels',
|
||||||
props: {
|
props: {
|
||||||
startLabels: {
|
value: {
|
||||||
default: () => [],
|
default: () => [],
|
||||||
type: Array,
|
type: Array,
|
||||||
},
|
},
|
||||||
|
@ -69,14 +69,14 @@
|
||||||
multiselect,
|
multiselect,
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
startLabels(newLabels) {
|
value(newLabels) {
|
||||||
this.labels = newLabels
|
this.labels = newLabels
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.labelService = new LabelService()
|
this.labelService = new LabelService()
|
||||||
this.labelTaskService = new LabelTaskService()
|
this.labelTaskService = new LabelTaskService()
|
||||||
this.labels = this.startLabels
|
this.labels = this.value
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
findLabel(query) {
|
findLabel(query) {
|
||||||
|
@ -112,6 +112,7 @@
|
||||||
this.labelTaskService.create(labelTask)
|
this.labelTaskService.create(labelTask)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.success({message: 'The label was successfully added.'}, this)
|
this.success({message: 'The label was successfully added.'}, this)
|
||||||
|
this.$emit('input', this.labels)
|
||||||
})
|
})
|
||||||
.catch(e => {
|
.catch(e => {
|
||||||
this.error(e, this)
|
this.error(e, this)
|
||||||
|
@ -128,6 +129,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.success({message: 'The label was successfully removed.'}, this)
|
this.success({message: 'The label was successfully removed.'}, this)
|
||||||
|
this.$emit('input', this.labels)
|
||||||
})
|
})
|
||||||
.catch(e => {
|
.catch(e => {
|
||||||
this.error(e, this)
|
this.error(e, this)
|
||||||
|
|
Loading…
Reference in a new issue