From 00884aab5ecb54f6d75d8a2415f1dfc93e2f9e69 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 16 Nov 2025 19:11:44 +0000 Subject: [PATCH] Fix label update by using label_ids array instead of label objects Co-authored-by: Mord0reK <135718526+Mord0reK@users.noreply.github.com> --- internal/glance/widget-vikunja.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/internal/glance/widget-vikunja.go b/internal/glance/widget-vikunja.go index 8b4cd56..240f924 100644 --- a/internal/glance/widget-vikunja.go +++ b/internal/glance/widget-vikunja.go @@ -235,15 +235,9 @@ func (widget *vikunjaWidget) updateTask(taskID int, title string, dueDate string payload["due_date"] = dueDate } - // Always send labels array, even if empty, to properly update label assignments - // Vikunja API expects full label objects when updating - labels := make([]map[string]interface{}, len(labelIDs)) - for i, labelID := range labelIDs { - labels[i] = map[string]interface{}{ - "id": labelID, - } - } - payload["labels"] = labels + // Vikunja API expects label_ids as an array of integers when updating tasks + // Not the full label objects with id/title/color + payload["label_ids"] = labelIDs jsonData, err := json.Marshal(payload) if err != nil {