Skip to content

Commit 7e1f359

Browse files
committed
Improve offset handling in top lens requests
1 parent c42f5ed commit 7e1f359

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/endpoints/explorer/top.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ const originalResponse = require('../../json/top.json');
99
var router = express.Router();
1010

1111
router.get('/', async function (req, res, next) {
12+
const { country, limit, offset } = req.query;
13+
if (offset >= originalResponse.lenses.length) {
14+
return res.json({});
15+
}
16+
1217
return res.json(Util.modifyResponseURLs(originalResponse));
1318
});
1419

0 commit comments

Comments
 (0)