From 2e23c7a684d10dc953ea15d1f274fddb87696fc5 Mon Sep 17 00:00:00 2001 From: Sander Hahn Date: Sat, 17 Aug 2019 02:20:31 +0200 Subject: [PATCH] make offset query --- site/src/routes/repl/archive.json.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/site/src/routes/repl/archive.json.js b/site/src/routes/repl/archive.json.js index 607d0bd4b3..6a000c4377 100644 --- a/site/src/routes/repl/archive.json.js +++ b/site/src/routes/repl/archive.json.js @@ -10,13 +10,13 @@ export async function get(req, res) { const user = await isUser(req, res); if (!user) return; // response already sent - const offset = req.params.offset || 0; + const offset = req.query.offset || 0; const rows = await query(` select g.uid, g.name, coalesce(g.updated_at, g.created_at) as updated_at from gists g where g.user_id = $1 order by g.updated_at desc, g.created_at desc - limit 100 + limit 20 offset $2 `, [user.id, offset]);