fix(backend): users/notes で途中までしかページネーションできなくなることがある問題を修正

This commit is contained in:
syuilo 2023-10-09 16:54:27 +09:00
parent 0f367da84b
commit 0680ea3a78
1 changed files with 39 additions and 37 deletions

View File

@ -144,8 +144,11 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
timeline.sort((a, b) => a.id > b.id ? -1 : 1); timeline.sort((a, b) => a.id > b.id ? -1 : 1);
if (timeline.length > 0) {
return await this.noteEntityService.packMany(timeline, me); return await this.noteEntityService.packMany(timeline, me);
} else { }
}
// fallback to database // fallback to database
//#region Construct query //#region Construct query
@ -182,7 +185,6 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
const timeline = await query.limit(ps.limit).getMany(); const timeline = await query.limit(ps.limit).getMany();
return await this.noteEntityService.packMany(timeline, me); return await this.noteEntityService.packMany(timeline, me);
}
}); });
} }
} }