♻️ refactor: start tracking page numbers from 0 instead of 1 in the backend (#467)
Co-authored-by: neon_arch <mustafadhuleb53@gmail.com>
This commit is contained in:
parent
9f23a1c70b
commit
d073aa247a
1 changed files with 3 additions and 3 deletions
|
@ -59,11 +59,11 @@ pub async fn search(
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
// .max(1) makes sure that the page > 0.
|
// .max(1) makes sure that the page >= 0.
|
||||||
let page = params.page.unwrap_or(1).max(1);
|
let page = params.page.unwrap_or(1).max(1) - 1;
|
||||||
|
|
||||||
let (_, results, _) = join!(
|
let (_, results, _) = join!(
|
||||||
get_results(page - 1),
|
get_results(page.saturating_sub(1)),
|
||||||
get_results(page),
|
get_results(page),
|
||||||
get_results(page + 1)
|
get_results(page + 1)
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Reference in a new issue