aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/lib/Controller
diff options
context:
space:
mode:
authorElizabeth Danzberger <lizzy7128@tutanota.de>2025-05-09 17:21:22 -0400
committerElizabeth Danzberger <lizzy7128@tutanota.de>2025-05-19 17:51:25 -0400
commit5c7216f3fde391699e910d367efe7405c7d930c1 (patch)
tree6e492107104a7deeebba2f9f1e00894724ce9fa8 /apps/files/lib/Controller
parent5129a797207d0ba2dac5c42d7f7154068dd9ff39 (diff)
downloadnextcloud-server-5c7216f3fde391699e910d367efe7405c7d930c1.tar.gz
nextcloud-server-5c7216f3fde391699e910d367efe7405c7d930c1.zip
feat: only load template fields when requested
Signed-off-by: Elizabeth Danzberger <lizzy7128@tutanota.de>
Diffstat (limited to 'apps/files/lib/Controller')
-rw-r--r--apps/files/lib/Controller/TemplateController.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/apps/files/lib/Controller/TemplateController.php b/apps/files/lib/Controller/TemplateController.php
index 3321fb5f119..c985f05f2ed 100644
--- a/apps/files/lib/Controller/TemplateController.php
+++ b/apps/files/lib/Controller/TemplateController.php
@@ -53,6 +53,23 @@ 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
+ */
+ 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