Return updated board on PUT /boards/:id#2848
Return updated board on PUT /boards/:id#2848robzolkos wants to merge 5 commits intobasecamp:mainfrom
Conversation
The JSON response was `204 No Content`, forcing clients to make a follow-up GET to observe their own write. The Smithy contract the SDKs are generated from already declares `UpdateBoard` returns a Board, so the server was out of sync with the documented shape. Render `show` for the JSON format so PUT returns the same payload as GET. The HTML format is unchanged. Updated test asserts the returned body matches the updated state. Updated API docs to show the 200 response shape.
There was a problem hiding this comment.
Pull request overview
This PR aligns the PUT /:account_slug/boards/:board_id JSON behavior with the documented/contracted API shape by returning the updated Board payload (matching GET /:account_slug/boards/:board_id) instead of 204 No Content, avoiding a forced follow-up GET for clients.
Changes:
- Return
render :showfor JSON updates to boards (instead ofhead :no_content). - Update controller test to assert returned JSON fields on update.
- Update API docs to describe the
200 OKresponse body for board updates.
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.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| app/controllers/boards_controller.rb | Changes JSON update response to render the board payload via the show view. |
| test/controllers/boards_controller_test.rb | Updates the JSON update test to validate response body fields. |
| docs/api/sections/boards.md | Updates API documentation to reflect 200 OK with board JSON on update. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Updated the JSON self-removal case: successful board updates now return |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@flavorjones we need to check this isn't affecting the mobile apps. Edit - checked, and it does not. |
Summary
The JSON response for
PUT /:account_slug/boards/:board_idwas204 No Content, forcing clients to do a follow-upGETto observe the result of their own write. The Smithy contract the SDKs are generated from already declaresUpdateBoardreturns a Board, so the server was out of sync with the documented shape.This changes the JSON update path to return the same payload shape as
GET /:account_slug/boards/:board_idwhen the caller still has access after the update. If the update succeeds but removes the caller's own access to the board, the endpoint returns204 No Contentinstead of returning a board they can no longer access. The HTML redirect behavior is unchanged.Discovered via a fizzy-cli QA sweep —
fizzy board updaterendered an all-blank result because the CLI was parsing an empty body as a zero-valued Board.Changes
app/controllers/boards_controller.rb:showwhen access remains after the update204 No Contentwhen the update removes the caller's own accesstest/controllers/boards_controller_test.rbtest/controllers/api/flat_json_params_test.rbdocs/api/sections/boards.md200 OKresponse body for successful updates204 No Contentresponse when the update removes the caller's own accessMobile App check
PUT /boards/:id204 No Content200 OKwith the updated board