]> BookStack Code Mirror - bookstack/blobdiff - app/Http/Controllers/PageTemplateController.php
Fix timestamp in API docs example response
[bookstack] / app / Http / Controllers / PageTemplateController.php
index 05943351a06f1b47a7ba36e6052eabd215e73094..1e24c29eeffd40c27fa63ffbe6168fb27f7ade49 100644 (file)
@@ -12,52 +12,46 @@ class PageTemplateController extends Controller
 
     /**
      * PageTemplateController constructor.
-     * @param $pageRepo
      */
     public function __construct(PageRepo $pageRepo)
     {
         $this->pageRepo = $pageRepo;
-        parent::__construct();
     }
 
     /**
      * Fetch a list of templates from the system.
-     * @param Request $request
-     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
      */
     public function list(Request $request)
     {
         $page = $request->get('page', 1);
         $search = $request->get('search', '');
-        $templates = $this->pageRepo->getPageTemplates(10, $page, $search);
+        $templates = $this->pageRepo->getTemplates(10, $page, $search);
 
         if ($search) {
             $templates->appends(['search' => $search]);
         }
 
-        return view('pages.template-manager-list', [
-            'templates' => $templates
+        return view('pages.parts.template-manager-list', [
+            'templates' => $templates,
         ]);
     }
 
     /**
      * Get the content of a template.
-     * @param $templateId
-     * @return \Illuminate\Contracts\Routing\ResponseFactory|\Symfony\Component\HttpFoundation\Response
+     *
      * @throws NotFoundException
      */
-    public function get($templateId)
+    public function get(int $templateId)
     {
-        $page = $this->pageRepo->getById('page', $templateId);
+        $page = $this->pageRepo->getById($templateId);
 
         if (!$page->template) {
             throw new NotFoundException();
         }
 
         return response()->json([
-            'html' => $page->html,
+            'html'     => $page->html,
             'markdown' => $page->markdown,
         ]);
     }
-
 }