فهرست منبع

refactor getting template api

Yuki Takei 2 سال پیش
والد
کامیت
115327cbbc
1فایلهای تغییر یافته به همراه10 افزوده شده و 4 حذف شده
  1. 10 4
      apps/app/src/features/templates/server/routes/apiv3/index.ts

+ 10 - 4
apps/app/src/features/templates/server/routes/apiv3/index.ts

@@ -16,8 +16,6 @@ const validator = {
     query('includeInvalidTemplates').optional().isBoolean(),
     query('includeInvalidTemplates').optional().isBoolean(),
   ],
   ],
   get: [
   get: [
-    param('organizationName').isString(),
-    param('reposName').isString(),
     param('templateId').isString(),
     param('templateId').isString(),
     param('locale').isString(),
     param('locale').isString(),
   ],
   ],
@@ -35,9 +33,9 @@ module.exports = (crowi) => {
     return res.apiv3(status);
     return res.apiv3(status);
   });
   });
 
 
-  router.get('/:organizationName/:reposName/:templateId/:locale', loginRequiredStrictly, validator.get, apiV3FormValidator, async(req, res: ApiV3Response) => {
+  router.get('/preset-templates/:templateId/:locale', loginRequiredStrictly, validator.get, apiV3FormValidator, async(req, res: ApiV3Response) => {
     const {
     const {
-      organizationName, reposName, templateId, locale,
+      templateId, locale,
     } = req.params;
     } = req.params;
 
 
     const presetTemplatesRoot = resolveFromRoot('../../node_modules/@growi/preset-templates');
     const presetTemplatesRoot = resolveFromRoot('../../node_modules/@growi/preset-templates');
@@ -46,5 +44,13 @@ module.exports = (crowi) => {
     return res.apiv3({ markdown });
     return res.apiv3({ markdown });
   });
   });
 
 
+  router.get('/plugin-templates/:pluginId/:templateId/:locale', loginRequiredStrictly, validator.get, apiV3FormValidator, async(req, res: ApiV3Response) => {
+    const {
+      pluginId, templateId, locale,
+    } = req.params;
+
+    return res.apiv3({});
+  });
+
   return router;
   return router;
 };
 };