use crate::client::HevyClient;
use crate::error::Result;
use crate::models::ExerciseHistoryEntry;
use crate::models::ExerciseHistoryEnvelope;
impl HevyClient {
pub async fn exercise_history(
&self,
exercise_template_id: &str,
start_date: Option<&str>,
end_date: Option<&str>,
) -> Result<Vec<ExerciseHistoryEntry>> {
let envelope: ExerciseHistoryEnvelope = self
.get(
&format!("/v1/exercise_history/{exercise_template_id}"),
&[
("start_date", start_date.map(|s| s.to_string())),
("end_date", end_date.map(|s| s.to_string())),
],
)
.await?;
Ok(envelope.exercise_history)
}
}