Implement stack and card reordering

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2019-09-05 22:37:47 +02:00
parent 91f9b8ee72
commit 695042cdd0
6 changed files with 58 additions and 5 deletions

View File

@@ -55,7 +55,7 @@ class CardController extends Controller {
* @return array
*/
public function reorder($cardId, $stackId, $order) {
return $this->cardService->reorder($cardId, $stackId, $order);
return $this->cardService->reorder((int)$cardId, (int)$stackId, (int)$order);
}
/**

View File

@@ -88,7 +88,7 @@ class StackController extends Controller {
* @return array
*/
public function reorder($stackId, $order) {
return $this->stackService->reorder($stackId, $order);
return $this->stackService->reorder((int)$stackId, (int)$order);
}
/**

View File

@@ -400,6 +400,11 @@ class CardService {
if ($this->boardService->isArchived($this->cardMapper, $id)) {
throw new StatusException('Operation not allowed. This board is archived.');
}
$card = $this->cardMapper->find($id);
$card->setStackId($stackId);
$this->cardMapper->update($card);
$cards = $this->cardMapper->findAll($stackId);
$result = [];
$i = 0;