diff --git a/lib/Controller/ApiTablesController.php b/lib/Controller/ApiTablesController.php index 11cf56962..0ee061d20 100644 --- a/lib/Controller/ApiTablesController.php +++ b/lib/Controller/ApiTablesController.php @@ -78,15 +78,16 @@ public function show(int $id): DataResponse { * * @param string $title Title of the table * @param string|null $emoji Emoji for the table + * @param string|null $description Description for the table * @param string $template Template to use if wanted * * @return DataResponse|DataResponse * * 200: Tables returned */ - public function create(string $title, ?string $emoji, string $template = 'custom'): DataResponse { + public function create(string $title, ?string $emoji, ?string $description, string $template = 'custom'): DataResponse { try { - return new DataResponse($this->service->create($title, $template, $emoji)->jsonSerialize()); + return new DataResponse($this->service->create($title, $template, $emoji, $description)->jsonSerialize()); } catch (InternalError|Exception $e) { return $this->handleError($e); } diff --git a/lib/Service/TableService.php b/lib/Service/TableService.php index 7f6dec1f8..2ee7685d7 100644 --- a/lib/Service/TableService.php +++ b/lib/Service/TableService.php @@ -255,12 +255,13 @@ public function find(int $id, bool $skipTableEnhancement = false, ?string $userI * @throws InternalError * @noinspection DuplicatedCode */ - public function create(string $title, string $template, ?string $emoji, ?string $userId = null): Table { + public function create(string $title, string $template, ?string $emoji, ?string $description = '', ?string $userId = null): Table { $userId = $this->permissionsService->preCheckUserId($userId, false); // we can assume that the $userId is set $time = new DateTime(); $item = new Table(); $item->setTitle($title); + $item->setDescription($description); if($emoji) { $item->setEmoji($emoji); } diff --git a/openapi.json b/openapi.json index 18788f5ec..41d136387 100644 --- a/openapi.json +++ b/openapi.json @@ -5077,6 +5077,15 @@ "nullable": true } }, + { + "name": "description", + "in": "query", + "description": "Description for the table", + "schema": { + "type": "string", + "nullable": true + } + }, { "name": "template", "in": "query", diff --git a/src/modules/modals/CreateTable.vue b/src/modules/modals/CreateTable.vue index 3eceaf1d9..1dcd7801c 100644 --- a/src/modules/modals/CreateTable.vue +++ b/src/modules/modals/CreateTable.vue @@ -28,6 +28,14 @@ @input="titleChangedManually"> +
+
+ {{ t('tables', 'Description') }} +
+
+ +
+