From b777e00d945f7c3417e8d74c23dddcc7b0158869 Mon Sep 17 00:00:00 2001 From: Robin Dittmar Date: Fri, 21 Aug 2026 21:44:00 +0200 Subject: [PATCH] fix: sql identifier in get lists query --- internal/repository/list.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/repository/list.go b/internal/repository/list.go index 5173f4f..dd451ed 100644 --- a/internal/repository/list.go +++ b/internal/repository/list.go @@ -70,7 +70,7 @@ func (r *ListRepo) DeleteList(ctx context.Context, listID string) error { func (r *ListRepo) GetLists(ctx context.Context, userID string) ([]domain.List, error) { rows, err := r.db.QueryContext(ctx, - "SELECT l.id, l.name, l.created_at, l.modified_at, (SELECT COUNT(*) FROM list_items WHERE list_id=l.id), (SELECT COUNT(*) FROM list_items WHERE list_id=l.id AND is_completed=true) FROM lists AS l INNER JOIN list_users ON lists.id=list_users.list_id WHERE list_users.user_id = $1", + "SELECT l.id, l.name, l.created_at, l.modified_at, (SELECT COUNT(*) FROM list_items WHERE list_id=l.id), (SELECT COUNT(*) FROM list_items WHERE list_id=l.id AND is_completed=true) FROM lists AS l INNER JOIN list_users ON l.id=list_users.list_id WHERE list_users.user_id = $1", userID, ) if err != nil {