Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion internal/cli/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,8 @@ func (c *Client) ListComments(wsSlug, itemSlug string) ([]models.Comment, error)

func (c *Client) CreateComment(wsSlug, itemSlug string, input models.CommentCreate) (*models.Comment, error) {
var result models.Comment
return &result, c.post("/workspaces/"+wsSlug+"/items/"+itemSlug+"/comments", input, &result)
err := c.post("/workspaces/"+wsSlug+"/items/"+itemSlug+"/comments", input, &result)
return &result, wrapItemNotFound(err, itemSlug, wsSlug)
}

func (c *Client) DeleteComment(wsSlug, commentID string) error {
Expand Down
3 changes: 3 additions & 0 deletions internal/cli/item_notfound_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ func TestGetItemWrapsNotFound(t *testing.T) {
if err := client.DeleteItem("docapp", "TASK-999999"); err == nil || err.Error() != want {
t.Errorf("DeleteItem: got %v, want %q", err, want)
}
if _, err := client.CreateComment("docapp", "TASK-999999", models.CommentCreate{Body: "test"}); err == nil || err.Error() != want {
t.Errorf("CreateComment: got %v, want %q", err, want)
}
}

// TestNotFoundPreservesDetails confirms the enriched *APIError carries the
Expand Down