diff options
author | Elizabeth Danzberger <lizzy7128@tutanota.de> | 2024-07-24 15:59:37 -0400 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2024-07-25 11:11:40 +0200 |
commit | efe03ee690e2ba8080df63719eff119216c32ddb (patch) | |
tree | 2e8a2a879dbd99d54b7cfde680e8468703dc795e /apps/files | |
parent | a7addcb88f22e2ed46b3d2379424f3f41535cd9d (diff) | |
download | nextcloud-server-efe03ee690e2ba8080df63719eff119216c32ddb.tar.gz nextcloud-server-efe03ee690e2ba8080df63719eff119216c32ddb.zip |
feat: Add support for filling fields to backend components
Signed-off-by: Elizabeth Danzberger <lizzy7128@tutanota.de>
Diffstat (limited to 'apps/files')
-rw-r--r-- | apps/files/lib/Controller/TemplateController.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/apps/files/lib/Controller/TemplateController.php b/apps/files/lib/Controller/TemplateController.php index c5f0a2fb5e2..f4770cb5623 100644 --- a/apps/files/lib/Controller/TemplateController.php +++ b/apps/files/lib/Controller/TemplateController.php @@ -51,15 +51,25 @@ class TemplateController extends OCSController { * @param string $filePath Path of the file * @param string $templatePath Name of the template * @param string $templateType Type of the template + * @param array $templateFields Fields of the template * * @return DataResponse<Http::STATUS_OK, FilesTemplateFile, array{}> * @throws OCSForbiddenException Creating template is not allowed * * 200: Template created successfully */ - public function create(string $filePath, string $templatePath = '', string $templateType = 'user'): DataResponse { + public function create( + string $filePath, + string $templatePath = '', + string $templateType = 'user', + array $templateFields = [] + ): DataResponse { try { - return new DataResponse($this->templateManager->createFromTemplate($filePath, $templatePath, $templateType)); + return new DataResponse($this->templateManager->createFromTemplate( + $filePath, + $templatePath, + $templateType, + $templateFields)); } catch (GenericFileException $e) { throw new OCSForbiddenException($e->getMessage()); } |