forked from jelson.rodrigues/piperun-bot
fix: read chats from api when is only one page
This commit is contained in:
@@ -459,6 +459,8 @@ fn get_piperun_chats_on_date(PIPERUN_API_URL: &String, client: &reqwest::blockin
|
||||
let current_page = json_response["current_page"].as_i64().expect("Failed to obtain current page number");
|
||||
let last_page = json_response["last_page"].as_i64().expect("Failed to obtain current page number");
|
||||
|
||||
if current_page == last_page { return aggregated_talks; }
|
||||
|
||||
let mut all_other_messages = (current_page..last_page).into_iter()
|
||||
.map(|page| {
|
||||
let page_to_request = page + 1;
|
||||
|
||||
Reference in New Issue
Block a user