Skip to content

Return moved card on PUT /cards/:number/board#2849

Open
robzolkos wants to merge 1 commit intobasecamp:mainfrom
robzolkos:card-move-returns-body
Open

Return moved card on PUT /cards/:number/board#2849
robzolkos wants to merge 1 commit intobasecamp:mainfrom
robzolkos:card-move-returns-body

Conversation

@robzolkos
Copy link
Copy Markdown
Collaborator

@robzolkos robzolkos commented Apr 16, 2026

Summary

The JSON response for PUT /:account_slug/cards/:card_number/board 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.

Rendering cards/show on the JSON path means the response now carries the moved card (with its new board reference) directly. The HTML redirect behavior is unchanged.

Discovered via a fizzy-cli QA sweep — fizzy card move rendered a zero-valued Card and emitted Card #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.rbformat.json { head :no_content }format.json { render "cards/show" }
  • test/controllers/cards/boards_controller_test.rb — "update as JSON" test now asserts id, number, title, and board.id on the returned body
  • docs/api/sections/cards.md — added a section documenting PUT /:account_slug/cards/:card_number/board, which was previously undocumented

Mobile App check

  • Neither mobile app has native client code calling PUT /cards/:number/board
  • Neither mobile app has code paths that depend on this endpoint returning 204 No Content
  • Neither mobile app is affected by this response change to 200 OK with the moved card

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.
Copilot AI review requested due to automatic review settings April 16, 2026 19:52
Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/board by rendering cards/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/board endpoint 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.

Comment thread docs/api/sections/cards.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants