|
|
@ -10,13 +10,13 @@ export async function get(req, res) {
|
|
|
|
const user = await isUser(req, res);
|
|
|
|
const user = await isUser(req, res);
|
|
|
|
if (!user) return; // response already sent
|
|
|
|
if (!user) return; // response already sent
|
|
|
|
|
|
|
|
|
|
|
|
const offset = req.params.offset || 0;
|
|
|
|
const offset = req.query.offset || 0;
|
|
|
|
const rows = await query(`
|
|
|
|
const rows = await query(`
|
|
|
|
select g.uid, g.name, coalesce(g.updated_at, g.created_at) as updated_at
|
|
|
|
select g.uid, g.name, coalesce(g.updated_at, g.created_at) as updated_at
|
|
|
|
from gists g
|
|
|
|
from gists g
|
|
|
|
where g.user_id = $1
|
|
|
|
where g.user_id = $1
|
|
|
|
order by g.updated_at desc, g.created_at desc
|
|
|
|
order by g.updated_at desc, g.created_at desc
|
|
|
|
limit 100
|
|
|
|
limit 20
|
|
|
|
offset $2
|
|
|
|
offset $2
|
|
|
|
`, [user.id, offset]);
|
|
|
|
`, [user.id, offset]);
|
|
|
|
|
|
|
|
|
|
|
|