From d0e3062beeecc7a63a038fa55f7488290b3711db Mon Sep 17 00:00:00 2001 From: kolaente Date: Tue, 29 Aug 2023 10:52:25 +0200 Subject: [PATCH] feat(tasks): allow filtering for reminders, assignees and labels with Typesense --- pkg/models/task_search.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pkg/models/task_search.go b/pkg/models/task_search.go index 0ef5a9fa2..07674a7f0 100644 --- a/pkg/models/task_search.go +++ b/pkg/models/task_search.go @@ -286,6 +286,21 @@ func (t *typesenseTaskSearcher) Search(opts *taskSearchOptions) (tasks []*Task, for _, f := range opts.filters { + if f.field == "reminders" { + f.field = "reminders.reminder" + continue + } + + if f.field == "assignees" { + f.field = "assignees.username" + continue + } + + if f.field == "labels" || f.field == "label_id" { + f.field = "labels.id" + continue + } + filter := f.field switch f.comparator {