aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/lib/Controller/TemplateController.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files/lib/Controller/TemplateController.php')
-rw-r--r--apps/files/lib/Controller/TemplateController.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/apps/files/lib/Controller/TemplateController.php b/apps/files/lib/Controller/TemplateController.php
index 3321fb5f119..ee4c86941c7 100644
--- a/apps/files/lib/Controller/TemplateController.php
+++ b/apps/files/lib/Controller/TemplateController.php
@@ -53,6 +53,24 @@ class TemplateController extends OCSController {
}
/**
+ * List the fields for the template specified by the given file ID
+ *
+ * @param int $fileId File ID of the template
+ * @return DataResponse<Http::STATUS_OK, array<string, FilesTemplateField>, array{}>
+ *
+ * 200: Fields returned
+ */
+ #[NoAdminRequired]
+ public function listTemplateFields(int $fileId): DataResponse {
+ $fields = $this->templateManager->listTemplateFields($fileId);
+
+ return new DataResponse(
+ array_merge([], ...$fields),
+ Http::STATUS_OK
+ );
+ }
+
+ /**
* Create a template
*
* @param string $filePath Path of the file