From 8d5cb335bd8734f1fc05c4b49ca143b1e8bcc268 Mon Sep 17 00:00:00 2001 From: kolaente Date: Mon, 12 Feb 2024 22:00:33 +0100 Subject: [PATCH] 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. --- frontend/src/components/tasks/partials/relatedTasks.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/tasks/partials/relatedTasks.vue b/frontend/src/components/tasks/partials/relatedTasks.vue index 71a15a1d11..ce82f3d4cd 100644 --- a/frontend/src/components/tasks/partials/relatedTasks.vue +++ b/frontend/src/components/tasks/partials/relatedTasks.vue @@ -261,7 +261,10 @@ const foundTasks = ref([]) 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[]) {