fix(tasks): sort done tasks last in relations

When adding a new task relation, the task search input would previously show all tasks in a seemingly random order, including done tasks. Usually, you don't care about these done tasks when adding relations. This change modifies the sort order so that done tasks show up last in the search results.
This commit is contained in:
kolaente 2024-02-12 22:00:33 +01:00
parent 71e62541a1
commit 8d5cb335bd
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 4 additions and 1 deletions

View File

@ -261,7 +261,10 @@ const foundTasks = ref<ITask[]>([])
async function findTasks(newQuery: string) {
query.value = newQuery
foundTasks.value = await taskService.getAll({}, {s: newQuery})
foundTasks.value = await taskService.getAll({}, {
s: newQuery,
sort_by: 'done',
})
}
function mapRelatedTasks(tasks: ITask[]) {