Skip to content
Open
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
2 changes: 1 addition & 1 deletion app/controllers/cards/boards_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def update

respond_to do |format|
format.html { redirect_to @card }
format.json { head :no_content }
format.json { render "cards/show" }
end
end

Expand Down
20 changes: 20 additions & 0 deletions docs/api/sections/cards.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,26 @@ __Response:__

Returns `204 No Content` on success.

## `PUT /:account_slug/cards/:card_number/board`

Moves a card to a different board.

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `board_id` | string | Yes | The ID of the board to move the card to |

Comment thread
robzolkos marked this conversation as resolved.
__Request:__

```json
{
"board_id": "03f5v9zkft4hj9qq0lsn9ohcm"
}
```

__Response:__

Returns `200 OK` with the moved card in the same shape as `GET /:account_slug/cards/:card_number`. The `board` field reflects the new board.

## `POST /:account_slug/cards/:card_number/triage`

Moves a card into a column.
Expand Down
8 changes: 7 additions & 1 deletion test/controllers/cards/boards_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@ class Cards::BoardsControllerTest < ActionDispatch::IntegrationTest

put card_board_path(card), params: { board_id: new_board.id }, as: :json

assert_response :no_content
assert_response :success
assert_equal new_board, card.reload.board

json = @response.parsed_body
assert_equal card.id, json["id"]
assert_equal card.number, json["number"]
assert_equal card.title, json["title"]
assert_equal new_board.id, json["board"]["id"]
end
end
Loading