fix(backend): users/notesでsinceId指定時にデータベースにフォールバックするように修正

This commit is contained in:
syuilo 2023-10-09 18:14:38 +09:00
parent 04971ca565
commit 7473b2854f

View file

@ -72,6 +72,9 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private idService: IdService,
) {
super(meta, paramDef, async (ps, me) => {
const isRangeSpecified = (ps.sinceId != null || ps.sinceDate != null) && (ps.untilId != null || ps.untilDate != null);
if (isRangeSpecified || !(ps.sinceId != null || ps.sinceDate != null)) {
const [
userIdsWhoMeMuting,
] = me ? await Promise.all([
@ -148,6 +151,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
return await this.noteEntityService.packMany(timeline, me);
}
}
}
// fallback to database