diff --git a/committer/src/api.rs b/committer/src/api.rs index cab1c336..ded12abb 100644 --- a/committer/src/api.rs +++ b/committer/src/api.rs @@ -91,7 +91,7 @@ async fn metrics(registry: web::Data>) -> impl Responder { } #[derive(Deserialize)] -#[serde(tag = "variant", content = "value")] +#[serde(rename_all = "lowercase", tag = "variant", content = "value")] enum HeightVariant { Latest, Height(u32), @@ -99,7 +99,7 @@ enum HeightVariant { #[derive(Deserialize)] struct CostQueryParams { - from_height: HeightVariant, + variant: HeightVariant, limit: Option, } @@ -110,7 +110,7 @@ async fn costs( ) -> impl Responder { let limit = query.limit.unwrap_or(100); - let response = match query.from_height { + let response = match query.variant { HeightVariant::Latest => data.get_latest_costs(limit).await, HeightVariant::Height(from_height) => data.get_costs(from_height, limit).await, };