Additional cleanup and warning fixing
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
use anyhow::Result;
|
||||
use chrono::NaiveDate;
|
||||
use reqwest::Client;
|
||||
use serde::Deserialize;
|
||||
|
||||
@@ -21,21 +20,6 @@ impl SmsApiClient {
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn fetch_messages_for_date(&self, date: NaiveDate) -> Result<Vec<SmsMessage>> {
|
||||
// Calculate date range (midnight to midnight in local time)
|
||||
let start = date
|
||||
.and_hms_opt(0, 0, 0)
|
||||
.ok_or_else(|| anyhow::anyhow!("Invalid start time"))?;
|
||||
let end = date
|
||||
.and_hms_opt(23, 59, 59)
|
||||
.ok_or_else(|| anyhow::anyhow!("Invalid end time"))?;
|
||||
|
||||
let start_ts = start.and_utc().timestamp();
|
||||
let end_ts = end.and_utc().timestamp();
|
||||
|
||||
self.fetch_messages(start_ts, end_ts, None, None).await
|
||||
}
|
||||
|
||||
/// Fetch messages for a specific contact within ±1 day of the given timestamp
|
||||
/// Falls back to all contacts if no messages found for the specific contact
|
||||
/// Messages are sorted by proximity to the center timestamp
|
||||
|
||||
Reference in New Issue
Block a user