Closed danielinoa closed 6 years ago
By default it's in descending order. https://github.com/vapor-community/pagination/blob/91658b8ff9300a196190faaa300b33c5e975783c/Sources/Pagination/Paginatable.swift#L23-L37
If you want to switch it, just override defaultPageSorts
extension Post: Paginatable {
static var defaultPageSorts: [Self.Database.QuerySort] {
return [
// My sorts
]
}
}
Let me know if that helps.
Closing this due to inactivity. If this issue still persists, let me know.
I ended up overriding defaultPageSorts
. Thanks so much for the help! 🙌
Paginated results seem to be outputted in descending order. I have a collection of 100 posts. Page
1
includes 10 posts going from post #100 to post #91. The function looks like this:Is this expected behavior?