takeru0001 5 лет назад
Родитель
Сommit
5994d80827
1 измененных файлов с 33 добавлено и 2 удалено
  1. 33 2
      src/server/routes/apiv3/page.js

+ 33 - 2
src/server/routes/apiv3/page.js

@@ -256,8 +256,39 @@ module.exports = (crowi) => {
     return stream.pipe(res);
   });
 
-  router.get('/exist-paths', loginRequired, validator.exist, async(req, res) => {
-    const { path, toPaths } = req.query;
+  /**
+   * @swagger
+   *
+   *    /page/exist-paths:
+   *      get:
+   *        tags: [Page]
+   *        summary: /page/exist-paths
+   *        description: Get already exist paths
+   *        operationId: getAlreadyExistPaths
+   *        parameters:
+   *          - name: newParentPath
+   *            in: query
+   *            description: New parent path of search
+   *            schema:
+   *              type: string
+   *          - name: toPaths
+   *            in: query
+   *            description: Paths to compare with DB
+   *            schema:
+   *              type: string
+   *        responses:
+   *          200:
+   *            description: Succeeded to retrieve pages.
+   *            content:
+   *              application/json:
+   *                schema:
+   *                  properties:
+   *                    existPaths:
+   *                      type: object
+   *                      description: Paths are already exist in DB
+   *          500:
+   *            description: Internal server error.
+   */
 
     try {
       const pageData = await Page.findByPath(path);