Return updated comment on PUT /cards/:n/comments/:id#2852
Open
robzolkos wants to merge 1 commit intobasecamp:mainfrom
Open
Return updated comment on PUT /cards/:n/comments/:id#2852robzolkos wants to merge 1 commit intobasecamp:mainfrom
robzolkos wants to merge 1 commit intobasecamp:mainfrom
Conversation
…omments/:comment_id
The JSON response was `204 No Content`, which conflicted with both
the API docs ("Returns the updated comment") and the Smithy
contract the SDKs are generated from (`UpdateCommentResponseContent`).
Render `show` for the JSON format so PUT returns the same payload
as GET. The Turbo Stream format is unchanged.
Docs already describe the correct response shape, so no doc change
is needed here. Tests now assert the returned body content.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aligns PUT /:account_slug/cards/:card_number/comments/:comment_id JSON behavior with the API docs and Smithy contract by returning the updated comment payload (instead of 204 No Content) after a successful update.
Changes:
- Update comments JSON update response to render the
showrepresentation (200 OKwith body). - Expand controller tests for JSON updates to assert key fields in the returned response body.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| app/controllers/cards/comments_controller.rb | Switches JSON update response from 204 to rendering :show so clients receive the updated comment. |
| test/controllers/cards/comments_controller_test.rb | Updates JSON update tests to validate the returned comment JSON fields (id/body/creator). |
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The JSON response for
PUT /:account_slug/cards/:card_number/comments/:comment_idwas204 No Content, which conflicted with both the API docs ("Returns the updated comment") and the Smithy contract the SDKs are generated from, which declaresUpdateCommentreturns a Comment.Rendering the
showtemplate on the JSON path makes the response match what the docs and spec already advertise. The Turbo Stream path is unchanged.Discovered during a fizzy-cli QA sweep — same class of issue as #2848, #2849, #2851.
Changes
app/controllers/cards/comments_controller.rb—format.json { head :no_content }→format.json { render :show }test/controllers/cards/comments_controller_test.rb— both "update as JSON" tests now assert the returned body (id, body plain_text, creator)docs/api/sections/comments.mdalready reads "Returns the updated comment."Mobile App check
PUT /cards/:n/comments/:id204 No Content200 OKwith the updated comment