Skip to content
Closed
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
8 changes: 7 additions & 1 deletion lib/Controller/CardApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,13 @@ public function unarchive(int $cardId): DataResponse {
#[CORS]
#[NoCSRFRequired]
public function reorder(int $stackId, int $order): DataResponse {
$card = $this->cardService->reorder((int)$this->request->getParam('cardId'), $stackId, $order);
// Read target stackId from request body to allow moving cards between stacks.
// The URL's {stackId} is the source stack (used in the route), but the request
// body can specify a different target stack for the move operation.
$input = json_decode(file_get_contents('php://input'), true);
$targetStackId = isset($input['stackId']) ? (int)$input['stackId'] : $stackId;

$card = $this->cardService->reorder((int)$this->request->getParam('cardId'), $targetStackId, $order);
return new DataResponse($card, HTTP::STATUS_OK);
}
}