1
0

fix(task): pass a list specified via quick add magic down to all subtasks created via indention

Resolves https://kolaente.dev/vikunja/frontend/issues/2771
This commit is contained in:
kolaente
2022-12-02 18:39:52 +01:00
parent 83fb8c3ded
commit b2da4fd126
5 changed files with 44 additions and 4 deletions

View File

@ -98,14 +98,20 @@ async function addTask() {
// by quick add magic.
const createdTasks: { [key: ITask['title']]: ITask } = {}
const tasksToCreate = parseSubtasksViaIndention(newTaskTitle.value)
const newTasks = tasksToCreate.map(async ({title}) => {
const newTasks = tasksToCreate.map(async ({title, list}) => {
if (title === '') {
return
}
// If the task has a list specified, make sure to use it
let listId = null
if (list !== null) {
listId = await taskStore.findListId({list, listId: 0})
}
const task = await taskStore.createNewTask({
title,
listId: authStore.settings.defaultListId,
listId: listId || authStore.settings.defaultListId,
position: props.defaultPosition,
})
createdTasks[title] = task