From 6664b24a23c0f5c090dcc436b9043fca3729b52b Mon Sep 17 00:00:00 2001 From: "Erik Winter (aider)" Date: Sun, 29 Dec 2024 12:03:01 +0100 Subject: [PATCH] fix: Implement TaskListParams filtering in SQLite FindMany method --- plan/storage/sqlite/task.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plan/storage/sqlite/task.go b/plan/storage/sqlite/task.go index 67453ca..25ded29 100644 --- a/plan/storage/sqlite/task.go +++ b/plan/storage/sqlite/task.go @@ -70,7 +70,7 @@ FROM tasks`) if err != nil { return nil, fmt.Errorf("%w: %v", ErrSqliteFailure, err) } - result := make([]item.Task, 0) + tasks := make([]item.Task, 0) defer rows.Close() for rows.Next() { var tsk item.Task @@ -87,10 +87,12 @@ FROM tasks`) tsk.Duration = dur tsk.Recurrer = item.NewRecurrer(recurStr) - result = append(result, tsk) + if storage.Match(tsk, params) { + tasks = append(tasks, tsk) + } } - return result, nil + return tasks, nil } func (s *SqliteTask) Delete(id string) error {