Return moved card on PUT /cards/:number/board#2849
Open
robzolkos wants to merge 1 commit intobasecamp:mainfrom
Open
Return moved card on PUT /cards/:number/board#2849robzolkos wants to merge 1 commit intobasecamp:mainfrom
robzolkos wants to merge 1 commit intobasecamp:mainfrom
Conversation
The JSON response was `204 No Content`, which forced clients to make a follow-up GET to see the card on its new board. The Smithy contract the SDKs are generated from already declares `MoveCard` returns a Card, so the server was out of sync with the documented shape. Render `cards/show` for the JSON format so the response carries the moved card (with the new `board` reference). The HTML format is unchanged. Added assertions on the returned body and added an API doc entry for the endpoint, which was previously undocumented.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aligns the PUT /:account_slug/cards/:card_number/board server response with the existing Smithy contract by returning the moved card as JSON (instead of 204 No Content), so clients don’t need a follow-up GET to see the updated board reference.
Changes:
- Return the moved card payload for JSON requests to
PUT /cards/:number/boardby renderingcards/show. - Update the controller test to assert the returned JSON includes key card fields and the new
board.id. - Document the previously-undocumented
PUT /:account_slug/cards/:card_number/boardendpoint in the API docs.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| app/controllers/cards/boards_controller.rb | Switch JSON response from 204 to rendering the moved card via cards/show. |
| test/controllers/cards/boards_controller_test.rb | Assert 200 + response body includes moved card fields and updated board reference. |
| docs/api/sections/cards.md | Add API documentation section for moving a card to a different board. |
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 was referenced Apr 17, 2026
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/boardwas204 No Content, which forced clients to make a follow-upGETto see the card on its new board. The Smithy contract the SDKs are generated from already declaresMoveCardreturns a Card, so the server was out of sync with the documented shape.Rendering
cards/showon the JSON path means the response now carries the moved card (with its newboardreference) directly. The HTML redirect behavior is unchanged.Discovered via a fizzy-cli QA sweep —
fizzy card moverendered a zero-valued Card and emittedCard #N "" moved to board X(blank title) because the CLI was parsing the empty 204 body as a Card struct.Changes
app/controllers/cards/boards_controller.rb—format.json { head :no_content }→format.json { render "cards/show" }test/controllers/cards/boards_controller_test.rb— "update as JSON" test now assertsid,number,title, andboard.idon the returned bodydocs/api/sections/cards.md— added a section documentingPUT /:account_slug/cards/:card_number/board, which was previously undocumentedMobile App check
PUT /cards/:number/board204 No Content200 OKwith the moved card