diff options
Diffstat (limited to 'internal/api')
| -rw-r--r-- | internal/api/google_tasks.go | 12 | ||||
| -rw-r--r-- | internal/api/interfaces.go | 1 | ||||
| -rw-r--r-- | internal/api/trello.go | 13 |
3 files changed, 20 insertions, 6 deletions
diff --git a/internal/api/google_tasks.go b/internal/api/google_tasks.go index da3cd3b..b580be4 100644 --- a/internal/api/google_tasks.go +++ b/internal/api/google_tasks.go @@ -163,6 +163,18 @@ func (c *GoogleTasksClient) CompleteTask(ctx context.Context, listID, taskID str return nil } +// UpdateTaskNotes updates a task's notes (description) +func (c *GoogleTasksClient) UpdateTaskNotes(ctx context.Context, listID, taskID, notes string) error { + task := &tasks.Task{ + Notes: notes, + } + _, err := c.srv.Tasks.Patch(listID, taskID, task).Context(ctx).Do() + if err != nil { + return fmt.Errorf("failed to update task notes: %v", err) + } + return nil +} + // UncompleteTask marks a task as not completed func (c *GoogleTasksClient) UncompleteTask(ctx context.Context, listID, taskID string) error { task := &tasks.Task{ diff --git a/internal/api/interfaces.go b/internal/api/interfaces.go index c5e154d..183f3f0 100644 --- a/internal/api/interfaces.go +++ b/internal/api/interfaces.go @@ -38,6 +38,7 @@ type GoogleTasksAPI interface { GetTasksByDateRange(ctx context.Context, start, end time.Time) ([]models.GoogleTask, error) CompleteTask(ctx context.Context, listID, taskID string) error UncompleteTask(ctx context.Context, listID, taskID string) error + UpdateTaskNotes(ctx context.Context, listID, taskID, notes string) error GetTaskLists(ctx context.Context) ([]models.TaskListInfo, error) SetTaskListID(id string) } diff --git a/internal/api/trello.go b/internal/api/trello.go index 1a5642c..d580d98 100644 --- a/internal/api/trello.go +++ b/internal/api/trello.go @@ -88,7 +88,7 @@ func (c *TrelloClient) GetBoards(ctx context.Context) ([]models.Board, error) { func (c *TrelloClient) GetCards(ctx context.Context, boardID string) ([]models.Card, error) { params := c.authParams() params.Set("filter", "open") - params.Set("fields", "id,name,idList,due,url,idBoard") + params.Set("fields", "id,name,desc,idList,due,url,idBoard") var apiCards []trelloCardResponse path := fmt.Sprintf("/boards/%s/cards?%s", boardID, params.Encode()) @@ -116,11 +116,12 @@ func (c *TrelloClient) GetCards(ctx context.Context, boardID string) ([]models.C cards := make([]models.Card, 0, len(apiCards)) for _, apiCard := range apiCards { card := models.Card{ - ID: apiCard.ID, - Name: apiCard.Name, - ListID: apiCard.IDList, - ListName: listMap[apiCard.IDList], - URL: apiCard.URL, + ID: apiCard.ID, + Name: apiCard.Name, + Description: apiCard.Desc, + ListID: apiCard.IDList, + ListName: listMap[apiCard.IDList], + URL: apiCard.URL, } if apiCard.Due != nil && *apiCard.Due != "" { |
