diff --git a/lib/Controller/CardController.php b/lib/Controller/CardController.php index 9aabdee16..eb85a520a 100644 --- a/lib/Controller/CardController.php +++ b/lib/Controller/CardController.php @@ -9,6 +9,7 @@ use OCA\Deck\Db\Assignment; use OCA\Deck\Db\Card; +use OCA\Deck\Model\OptionalNullableValue; use OCA\Deck\Service\AssignmentService; use OCA\Deck\Service\CardService; use OCP\AppFramework\Controller; @@ -63,8 +64,11 @@ public function create(string $title, int $stackId, string $type = 'plain', int * @param $duedate */ #[NoAdminRequired] - public function update(int $id, string $title, int $stackId, string $type, int $order, string $description, $duedate, $deletedAt): Card { - return $this->cardService->update($id, $title, $stackId, $type, $this->userId, $description, $order, $duedate, $deletedAt); + public function update(int $id, string $title, int $stackId, string $type, int $order, string $description, $duedate, $deletedAt, $archived = null): Card { + $done = array_key_exists('done', $this->request->getParams()) + ? new OptionalNullableValue($this->request->getParam('done', null)) + : null; + return $this->cardService->update($id, $title, $stackId, $type, $this->userId, $description, $order, $duedate, $deletedAt, $archived, $done); } #[NoAdminRequired]