Skip to content
Snippets Groups Projects
Commit 1a4b4348 authored by syuilo's avatar syuilo
Browse files

fix(backend): sort notes

Fix #10776
parent 0735ca08
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment