summaryrefslogtreecommitdiff
path: root/internal/api/trello.go
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-01-18 15:47:51 -1000
committerPeter Stone <thepeterstone@gmail.com>2026-01-18 15:47:51 -1000
commit791034f1b588bf679f45a0f89168515fcbde66d5 (patch)
treef7c75105ac4aa370bd22874dbe0bf976cba892ec /internal/api/trello.go
parent8dbb6f43577b8a86e94ef7aaee196f9743356643 (diff)
Fix Trello closed boards bug - filter API and clear stale cache
Closed boards were appearing because: 1. API fetched all boards including closed ones 2. Cache used upsert logic that never removed old data Fixes: - Add filter=open to GetBoards API call - Add filter=visible to GetCards API call - Clear boards/cards tables before inserting fresh data in SaveBoards Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'internal/api/trello.go')
-rw-r--r--internal/api/trello.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/api/trello.go b/internal/api/trello.go
index 7140f79..be5d81b 100644
--- a/internal/api/trello.go
+++ b/internal/api/trello.go
@@ -64,7 +64,7 @@ type trelloListResponse struct {
// GetBoards fetches all boards for the authenticated user
func (c *TrelloClient) GetBoards(ctx context.Context) ([]models.Board, error) {
- url := fmt.Sprintf("%s/members/me/boards?key=%s&token=%s", c.baseURL, c.apiKey, c.token)
+ url := fmt.Sprintf("%s/members/me/boards?key=%s&token=%s&filter=open", c.baseURL, c.apiKey, c.token)
req, err := http.NewRequestWithContext(ctx, "GET", url, nil)
if err != nil {
@@ -103,7 +103,7 @@ func (c *TrelloClient) GetBoards(ctx context.Context) ([]models.Board, error) {
// GetCards fetches all cards for a specific board
func (c *TrelloClient) GetCards(ctx context.Context, boardID string) ([]models.Card, error) {
- url := fmt.Sprintf("%s/boards/%s/cards?key=%s&token=%s", c.baseURL, boardID, c.apiKey, c.token)
+ url := fmt.Sprintf("%s/boards/%s/cards?key=%s&token=%s&filter=visible", c.baseURL, boardID, c.apiKey, c.token)
req, err := http.NewRequestWithContext(ctx, "GET", url, nil)
if err != nil {