use axum::{extract::State, Json}; use crate::{ app::AppState, error::AppResult, models::match_result::{MatchRewardResult, SubmitMatchRequest}, services::{club as club_svc, match_service, profile as profile_svc}, }; pub async fn post_match_result( State(state): State, Json(req): Json, ) -> AppResult> { let profile = profile_svc::get_active_profile(&state.pool).await?; let club = club_svc::get_club_by_profile(&state.pool, &profile.id).await?; let result = match_service::process_match(&state.pool, &profile.id, &club.id, &req, &state.obj_defs) .await?; Ok(Json(result)) }