use axum::extract::State; use axum::response::IntoResponse; use axum::Json; use crate::actions; use crate::app_state::AppState; use crate::http::app_error::AppError; use crate::http::helpers::ExtractAuthorizationToken; #[axum::debug_handler] pub async fn get_metrics( State(state): State, ExtractAuthorizationToken(project_token): ExtractAuthorizationToken, ) -> Result { let metrics = actions::fetch_metrics(&state.db, &project_token).await?; Ok(Json(metrics)) }