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.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/apps/files/lib/Controller/TemplateController.php b/apps/files/lib/Controller/TemplateController.php
index 08a324a46ec..5a163343223 100644
--- a/apps/files/lib/Controller/TemplateController.php
+++ b/apps/files/lib/Controller/TemplateController.php
@@ -64,12 +64,12 @@ class TemplateController extends OCSController {
*/
public function path(string $templatePath = '', bool $copySystemTemplates = false) {
try {
- $this->templateManager->setTemplatePath($templatePath);
- if ($copySystemTemplates) {
- $this->templateManager->initializeTemplateDirectory($templatePath);
- }
- return new DataResponse();
- } catch (GenericFileException $e) {
+ $templatePath = $this->templateManager->initializeTemplateDirectory($templatePath, null, $copySystemTemplates);
+ return new DataResponse([
+ 'template_path' => $templatePath,
+ 'templates' => $this->templateManager->listCreators()
+ ]);
+ } catch (\Exception $e) {
throw new OCSForbiddenException($e->getMessage());
}
}