diff --git a/docs/API.md b/docs/API.md index fa8982b19..01a97a42d 100644 --- a/docs/API.md +++ b/docs/API.md @@ -515,6 +515,8 @@ The board list endpoint supports setting an `If-Modified-Since` header to limit | title | String | The title of the new stack | | type | String | Type of the card (for later use) use 'plain' for now | | order | Integer | Order for sorting the stacks | +| description | String | _(optional)_ The markdown description of the card | +| duedate | timestamp | _(optional)_ The duedate of the card or null | #### Response diff --git a/lib/Controller/CardApiController.php b/lib/Controller/CardApiController.php index 2c598189d..805bbe6e6 100644 --- a/lib/Controller/CardApiController.php +++ b/lib/Controller/CardApiController.php @@ -76,8 +76,8 @@ class CardApiController extends ApiController { * * Get a specific card. */ - public function create($title, $type = 'plain', $order = 999, $description = '') { - $card = $this->cardService->create($title, $this->request->getParam('stackId'), $type, $order, $this->userId, $description); + public function create($title, $type = 'plain', $order = 999, $description = '', $duedate = null) { + $card = $this->cardService->create($title, $this->request->getParam('stackId'), $type, $order, $this->userId, $description, $duedate); return new DataResponse($card, HTTP::STATUS_OK); } diff --git a/lib/Service/CardService.php b/lib/Service/CardService.php index 447a19a43..9a85ac043 100644 --- a/lib/Service/CardService.php +++ b/lib/Service/CardService.php @@ -158,7 +158,7 @@ class CardService { * @throws \OCP\AppFramework\Db\MultipleObjectsReturnedException * @throws BadrequestException */ - public function create($title, $stackId, $type, $order, $owner, $description = '') { + public function create($title, $stackId, $type, $order, $owner, $description = '', $duedate = null) { if ($title === 'false' || $title === null) { throw new BadRequestException('title must be provided'); } @@ -190,6 +190,7 @@ class CardService { $card->setOrder($order); $card->setOwner($owner); $card->setDescription($description); + $card->setDuedate($duedate); $card = $this->cardMapper->insert($card); $this->activityManager->triggerEvent(ActivityManager::DECK_OBJECT_CARD, $card, ActivityManager::SUBJECT_CARD_CREATE); $this->changeHelper->cardChanged($card->getId(), false);