diff options
| author | anatawa12 <anatawa12@icloud.com> | 2023-11-26 12:54:23 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-26 12:54:23 +0900 |
| commit | d32631d1590ffe40f051e7abf75faab7bbf9c7da (patch) | |
| tree | c3074f4a3bf6c653453b69cc9e4fd20632b59706 /packages/backend/src | |
| parent | fix(backend): ギャラリーの人気の投稿の選出にidを用いるよ... (diff) | |
| download | sharkey-d32631d1590ffe40f051e7abf75faab7bbf9c7da.tar.gz sharkey-d32631d1590ffe40f051e7abf75faab7bbf9c7da.tar.bz2 sharkey-d32631d1590ffe40f051e7abf75faab7bbf9c7da.zip | |
fix: query error in notes/featured (#12439)
Diffstat (limited to 'packages/backend/src')
| -rw-r--r-- | packages/backend/src/server/api/endpoints/notes/featured.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/backend/src/server/api/endpoints/notes/featured.ts b/packages/backend/src/server/api/endpoints/notes/featured.ts index c456874309..bc6cbe242f 100644 --- a/packages/backend/src/server/api/endpoints/notes/featured.ts +++ b/packages/backend/src/server/api/endpoints/notes/featured.ts @@ -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') |