fix: page order
This commit is contained in:
@@ -59,7 +59,13 @@ export class AggregateService {
|
||||
}
|
||||
|
||||
getAllPages() {
|
||||
return this.pageService.model.find({}, 'title _id slug order').lean()
|
||||
return this.pageService.model
|
||||
.find({}, 'title _id slug order')
|
||||
.sort({
|
||||
order: -1,
|
||||
modified: -1,
|
||||
})
|
||||
.lean()
|
||||
}
|
||||
|
||||
async getLatestNote(cond: FilterQuery<DocumentType<NoteModel>> = {}) {
|
||||
|
||||
@@ -35,7 +35,9 @@ export class PageController {
|
||||
limit: size,
|
||||
page,
|
||||
select,
|
||||
sort: sortBy ? { [sortBy]: sortOrder || -1 } : { modified: -1 },
|
||||
sort: sortBy
|
||||
? { [sortBy]: sortOrder || -1 }
|
||||
: { order: -1, modified: -1 },
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user