|
|
@@ -366,16 +366,14 @@ module.exports = (crowi) => {
|
|
|
router.get('/recent', accessTokenParser, loginRequired, async(req, res) => {
|
|
|
const limit = 20;
|
|
|
const offset = parseInt(req.query.offset) || 0;
|
|
|
- const page = parseInt(req.query.page) || 1;
|
|
|
- // const offset = (+page - 1) * limit;
|
|
|
+ const skip = offset > 0 ? (offset - 1) * limit : offset;
|
|
|
const queryOptions = {
|
|
|
- offset,
|
|
|
+ offset: skip,
|
|
|
limit,
|
|
|
includeTrashed: false,
|
|
|
isRegExpEscapedFromPath: true,
|
|
|
sort: 'updatedAt',
|
|
|
desc: -1,
|
|
|
- page,
|
|
|
};
|
|
|
try {
|
|
|
const result = await Page.findListWithDescendants('/', req.user, queryOptions);
|