fix(tasks): correctly show different project in related tasks

This commit is contained in:
kolaente 2024-02-12 22:05:33 +01:00
parent 8d5cb335bd
commit 0b61885e89
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 4 additions and 2 deletions

View File

@ -261,16 +261,18 @@ const foundTasks = ref<ITask[]>([])
async function findTasks(newQuery: string) {
query.value = newQuery
foundTasks.value = await taskService.getAll({}, {
const result = await taskService.getAll({}, {
s: newQuery,
sort_by: 'done',
})
foundTasks.value = mapRelatedTasks(result)
}
function mapRelatedTasks(tasks: ITask[]) {
return tasks.map(task => {
// by doing this here once we can save a lot of duplicate calls in the template
const project = projectStore.projects[task.ProjectId]
const project = projectStore.projects[task.projectId]
return {
...task,