fix: execute renotes query

This commit is contained in:
Namekuji 2023-08-12 05:17:34 -04:00
parent e4bfde105b
commit 71bf3dc1d9
No known key found for this signature in database
GPG key ID: 1D62332C07FBA532

View file

@ -106,7 +106,13 @@ export default define(meta, paramDef, async (ps, user) => {
let untilDate: number | undefined; let untilDate: number | undefined;
while (foundPacked.length < ps.limit) { while (foundPacked.length < ps.limit) {
const foundNotes = ( const foundNotes = (
await execNotePaginationQuery({ ...ps, untilDate }, filter, 1) await execNotePaginationQuery(
"renotes",
{ ...ps, untilDate },
filter,
user?.id,
1,
)
).slice(0, ps.limit * 1.5); // Some may filtered out by Notes.packMany, thus we take more than ps.limit. ).slice(0, ps.limit * 1.5); // Some may filtered out by Notes.packMany, thus we take more than ps.limit.
foundPacked.push( foundPacked.push(
...(await Notes.packMany(foundNotes, user, { scyllaNote: true })), ...(await Notes.packMany(foundNotes, user, { scyllaNote: true })),