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>
|
||||
Labels
|
||||
</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>
|
||||
|
||||
<!-- Description -->
|
||||
|
|
|
@ -121,7 +121,7 @@
|
|||
<div class="field">
|
||||
<label class="label">Labels</label>
|
||||
<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>
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
export default {
|
||||
name: 'edit-labels',
|
||||
props: {
|
||||
startLabels: {
|
||||
value: {
|
||||
default: () => [],
|
||||
type: Array,
|
||||
},
|
||||
|
@ -69,14 +69,14 @@
|
|||
multiselect,
|
||||
},
|
||||
watch: {
|
||||
startLabels(newLabels) {
|
||||
value(newLabels) {
|
||||
this.labels = newLabels
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.labelService = new LabelService()
|
||||
this.labelTaskService = new LabelTaskService()
|
||||
this.labels = this.startLabels
|
||||
this.labels = this.value
|
||||
},
|
||||
methods: {
|
||||
findLabel(query) {
|
||||
|
@ -112,6 +112,7 @@
|
|||
this.labelTaskService.create(labelTask)
|
||||
.then(() => {
|
||||
this.success({message: 'The label was successfully added.'}, this)
|
||||
this.$emit('input', this.labels)
|
||||
})
|
||||
.catch(e => {
|
||||
this.error(e, this)
|
||||
|
@ -128,6 +129,7 @@
|
|||
}
|
||||
}
|
||||
this.success({message: 'The label was successfully removed.'}, this)
|
||||
this.$emit('input', this.labels)
|
||||
})
|
||||
.catch(e => {
|
||||
this.error(e, this)
|
||||
|
|
Loading…
Reference in a new issue