From 01aabe569f2ca9c4a1f311b1a21774c1ea16574f Mon Sep 17 00:00:00 2001 From: EthanYuan Date: Wed, 29 Dec 2021 15:57:31 +0800 Subject: [PATCH] fix(db): build_next_cursor error when order is desc --- core/storage/src/relational/fetch.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/core/storage/src/relational/fetch.rs b/core/storage/src/relational/fetch.rs index 73de16411..25a21afee 100644 --- a/core/storage/src/relational/fetch.rs +++ b/core/storage/src/relational/fetch.rs @@ -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) } }}; }