diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-08-13 08:38:29 +0000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-08-13 08:38:29 +0000 |
| commit | a03d7673e7adf9a575c7272b2b528a74b230535e (patch) | |
| tree | a4ac635d92eade4df117db2a4fbdfe1eff13d677 /internal/api/google_tasks.go | |
| parent | 2509dde6aa372a505b186657706f4d21bd391807 (diff) | |
Fix blank task-detail modal for Google Tasks
loadTaskDetailData/HandleUpdateTask only had cases for "trello" and
"doot" sources, so opening a gtask from the Tasks or Timeline tab
rendered an empty title/description. Reuses the existing
findGoogleTask cache lookup for both. Renamed the API client's
UpdateTaskNotes to UpdateTask(title, notes) so the web modal can save
an edited title too, not just description; the widget's
description-only edit popup now just round-trips the task's existing
title unchanged.
Diffstat (limited to 'internal/api/google_tasks.go')
| -rw-r--r-- | internal/api/google_tasks.go | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/internal/api/google_tasks.go b/internal/api/google_tasks.go index 1f9aefb..644f124 100644 --- a/internal/api/google_tasks.go +++ b/internal/api/google_tasks.go @@ -174,14 +174,19 @@ 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 { +// UpdateTask updates a task's title and notes (description). An empty +// title is omitted from the PATCH body by the underlying client library +// (omitempty), not sent as a blank -- so callers that don't support editing +// title (e.g. the widget's description-only edit popup) can pass the +// task's existing title back unchanged, or "" to leave it untouched. +func (c *GoogleTasksClient) UpdateTask(ctx context.Context, listID, taskID, title, notes string) error { task := &tasks.Task{ + Title: title, 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 fmt.Errorf("failed to update task: %v", err) } return nil } |
