Split bot and service
This commit is contained in:
@@ -74,7 +74,7 @@ async fn get_all(req: HttpRequest) -> HttpResponse {
|
||||
// Limit must be between 1 and 100
|
||||
let limit = std::cmp::min(std::cmp::max(params.limit.unwrap_or(20), 1), 100);
|
||||
let total_count = QuerySpell::get_count(&filters).unwrap();
|
||||
let max_page = std::cmp::max(1, (total_count as f64 / limit as f64).ceil() as i32);
|
||||
let max_page = std::cmp::max((total_count as f64 / limit as f64).ceil() as i32, 1);
|
||||
// Page must be between 1 and max_page
|
||||
let page = std::cmp::min(std::cmp::max(params.page.unwrap_or(1), 1), max_page);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user