|
@@ -7,8 +7,6 @@ const express = require('express');
|
|
|
|
|
|
|
|
const router = express.Router();
|
|
const router = express.Router();
|
|
|
|
|
|
|
|
-const PAGE_ITEMS = 5;
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* @swagger
|
|
* @swagger
|
|
@@ -88,8 +86,12 @@ module.exports = (crowi) => {
|
|
|
|
|
|
|
|
router.get('/list', accessTokenParser, loginRequired, async(req, res) => {
|
|
router.get('/list', accessTokenParser, loginRequired, async(req, res) => {
|
|
|
const { path } = req.query;
|
|
const { path } = req.query;
|
|
|
|
|
+ const limit = +req.query.limit || 50;
|
|
|
|
|
+ const offset = +req.query.offset || 0;
|
|
|
|
|
+ const queryOptions = { offset, limit };
|
|
|
|
|
+
|
|
|
try {
|
|
try {
|
|
|
- const result = await Page.findListWithDescendants(path, req.user, { limit:, offset});
|
|
|
|
|
|
|
+ const result = await Page.findListWithDescendants(path, req.user, queryOptions);
|
|
|
|
|
|
|
|
return res.apiv3(result);
|
|
return res.apiv3(result);
|
|
|
}
|
|
}
|