1
0

fix: remove getProjectById and replace all usages of it

This commit is contained in:
kolaente
2023-04-12 11:13:55 +02:00
parent 9402344b7e
commit 78158bcba5
14 changed files with 24 additions and 28 deletions

View File

@ -145,12 +145,12 @@ const foundProjects = computed(() => {
const history = getHistory()
const allProjects = [
...new Set([
...history.map((l) => projectStore.getProjectById(l.id)),
...history.map((l) => projectStore.projects[l.id]),
...projectStore.searchProject(project),
]),
]
return allProjects.filter((l) => typeof l !== 'undefined' && l !== null)
return allProjects.filter(l => Boolean(l))
})
// FIXME: use fuzzysearch
@ -369,7 +369,7 @@ function searchTasks() {
const r = await taskService.getAll({}, params) as DoAction<ITask>[]
foundTasks.value = r.map((t) => {
t.type = ACTION_TYPE.TASK
const project = projectStore.getProjectById(t.projectId)
const project = projectStore.projects[t.projectId]
if (project !== null) {
t.title = `${t.title} (${project.title})`
}