feat: create new card from smart picker

Signed-off-by: Luka Trovic <luka@nextcloud.com>
This commit is contained in:
Luka Trovic
2023-08-04 07:25:45 +02:00
committed by backportbot-nextcloud[bot]
parent 4d10663406
commit 1cd5f2f496
16 changed files with 927 additions and 469 deletions

View File

@@ -81,8 +81,17 @@ class CardApiController extends ApiController {
*
* Get a specific card.
*/
public function create($title, $type = 'plain', $order = 999, $description = '', $duedate = null) {
public function create($title, $type = 'plain', $order = 999, $description = '', $duedate = null, $labels = [], $users = []) {
$card = $this->cardService->create($title, $this->request->getParam('stackId'), $type, $order, $this->userId, $description, $duedate);
foreach ($labels as $labelId) {
$this->cardService->assignLabel($card->id, $labelId);
}
foreach ($users as $user) {
$this->assignmentService->assignUser($card->id, $user['id'], $user['type']);
}
return new DataResponse($card, HTTP::STATUS_OK);
}