1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-11-25 15:46:33 +09:00

fix(backend): sort notes

Fix #10776
This commit is contained in:
syuilo 2023-05-06 12:49:49 +09:00
parent 0735ca0853
commit 1a4b4348a9

View File

@ -139,9 +139,10 @@ export class SearchService {
limit: pagination.limit,
});
if (res.hits.length === 0) return [];
return await this.notesRepository.findBy({
const notes = await this.notesRepository.findBy({
id: In(res.hits.map(x => x.id)),
});
return notes.sort((a, b) => a.id > b.id ? -1 : 1);
} else {
const query = this.queryService.makePaginationQuery(this.notesRepository.createQueryBuilder('note'), pagination.sinceId, pagination.untilId);