diff options
Diffstat (limited to 'apps/files/lib/Controller')
-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()); } |