server: fix pagination with small counts and no first/last set
This commit is contained in:
parent
e8c58bdbd0
commit
d45f223d52
@ -142,11 +142,10 @@ impl QueryRoot {
|
|||||||
first,
|
first,
|
||||||
last,
|
last,
|
||||||
|after, before, first, last| async move {
|
|after, before, first, last| async move {
|
||||||
info!("{after:?} {before:?} {first:?} {last:?} {query}");
|
|
||||||
let total = nm.count(&query)?;
|
let total = nm.count(&query)?;
|
||||||
let (first, last) = if let (None, None) = (first, last) {
|
let (first, last) = if let (None, None) = (first, last) {
|
||||||
info!("neither first nor last set, defaulting to 20");
|
info!("neither first nor last set, defaulting first to 20");
|
||||||
(Some(20), Some(20))
|
(Some(20), None)
|
||||||
} else {
|
} else {
|
||||||
(first, last)
|
(first, last)
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user