notes/featured で結果がなかった場合にエラーになる可能性がある問題を修正 (MisskeyIO#263)

986623dbdc
This commit is contained in:
riku6460 2023-11-25 00:22:12 +09:00 committed by GitHub
parent 14804e03a5
commit 578cf343f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -64,16 +64,16 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
}
}
if (noteIds.length === 0) {
return [];
}
noteIds.sort((a, b) => a > b ? -1 : 1);
if (ps.untilId) {
noteIds = noteIds.filter(id => id < ps.untilId!);
}
noteIds = noteIds.slice(0, ps.limit);
if (noteIds.length === 0) {
return [];
}
const query = this.notesRepository.createQueryBuilder('note')
.where('note.id IN (:...noteIds)', { noteIds: noteIds })
.innerJoinAndSelect('note.user', 'user')