Skip to content
This repository was archived by the owner on Apr 9, 2024. It is now read-only.

fix(db): build_next_cursor error when order is desc #359

Merged
merged 1 commit into from
Dec 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions core/storage/src/relational/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,7 @@ macro_rules! build_next_cursor {
if $page.records.is_empty() || $page.total == $pagination.limit.unwrap_or(u64::MAX) {
None
} else {
if $pagination.order.is_asc() {
Some($page.records.last().cloned().unwrap().id)
} else {
Some($page.records.first().cloned().unwrap().id)
}
Some($page.records.last().cloned().unwrap().id)
}
}};
}
Expand Down