From b4022de717dfd0e911de87b65cb6f3610761dca2 Mon Sep 17 00:00:00 2001 From: Namekuji Date: Thu, 24 Aug 2023 05:56:04 -0400 Subject: [PATCH] fix: fetch more --- packages/backend/src/server/api/endpoints/clips/notes.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/clips/notes.ts b/packages/backend/src/server/api/endpoints/clips/notes.ts index 4c0e5eecff..6a832dd790 100644 --- a/packages/backend/src/server/api/endpoints/clips/notes.ts +++ b/packages/backend/src/server/api/endpoints/clips/notes.ts @@ -93,7 +93,7 @@ export default define(meta, paramDef, async (ps, user) => { select: ["noteId"], where: whereOpt, order: { noteId: "DESC" }, - take: ps.limit, + take: ps.limit * 5, }); if (noteIds.length === 0) { @@ -156,7 +156,7 @@ export default define(meta, paramDef, async (ps, user) => { .execute(prepared.note.select.byIds, [noteIds], { prepare: true }) .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(