forked from vikunja/frontend
fix: adding or creating a label with quick add magic (#944)
Co-authored-by: kolaente <k@knt.li> Reviewed-on: vikunja/frontend#944 Reviewed-by: dpschen <dpschen@noreply.kolaente.de> Co-authored-by: konrad <k@knt.li> Co-committed-by: konrad <k@knt.li>
This commit is contained in:
parent
7e82aa83e6
commit
58986c4a7a
|
@ -223,13 +223,12 @@ export default {
|
||||||
|
|
||||||
const labelAddsToWaitFor = parsedLabels.map(async labelTitle => {
|
const labelAddsToWaitFor = parsedLabels.map(async labelTitle => {
|
||||||
let label = validateLabel(labels, labelTitle)
|
let label = validateLabel(labels, labelTitle)
|
||||||
if (typeof label !== 'undefined') {
|
if (typeof label === 'undefined') {
|
||||||
return label
|
// label not found, create it
|
||||||
|
const labelModel = new LabelModel({title: labelTitle})
|
||||||
|
label = await dispatch('labels/createLabel', labelModel, {root: true})
|
||||||
}
|
}
|
||||||
|
|
||||||
// label not found, create it
|
|
||||||
const labelModel = new LabelModel({title: labelTitle})
|
|
||||||
await dispatch('labels/createLabel', labelModel, {root: true})
|
|
||||||
return addLabelToTask(task, label)
|
return addLabelToTask(task, label)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user