fix: fetch more

This commit is contained in:
Namekuji 2023-08-24 05:56:04 -04:00
parent ec3ad96d81
commit b4022de717
No known key found for this signature in database
GPG key ID: 1D62332C07FBA532

View file

@ -93,7 +93,7 @@ export default define(meta, paramDef, async (ps, user) => {
select: ["noteId"], select: ["noteId"],
where: whereOpt, where: whereOpt,
order: { noteId: "DESC" }, order: { noteId: "DESC" },
take: ps.limit, take: ps.limit * 5,
}); });
if (noteIds.length === 0) { if (noteIds.length === 0) {
@ -156,7 +156,7 @@ export default define(meta, paramDef, async (ps, user) => {
.execute(prepared.note.select.byIds, [noteIds], { prepare: true }) .execute(prepared.note.select.byIds, [noteIds], { prepare: true })
.then((result) => result.rows.map(parseScyllaNote)); .then((result) => result.rows.map(parseScyllaNote));
return Notes.packMany(await filter(foundNotes), user); return Notes.packMany((await filter(foundNotes)).slice(0, ps.limit), user);
} }
const query = makePaginationQuery( const query = makePaginationQuery(