wip: checkpoint multi-game core work
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
use crate::extractors::GameId;
|
||||
use axum::{
|
||||
extract::{Path, State},
|
||||
Json,
|
||||
@@ -27,10 +28,11 @@ pub struct ApplyChemStyleRequest {
|
||||
/// POST /collection/:owned_card_id/chemistry-style
|
||||
pub async fn post_apply_chemistry_style(
|
||||
State(state): State<AppState>,
|
||||
game: GameId,
|
||||
Path(owned_card_id): Path<String>,
|
||||
Json(req): Json<ApplyChemStyleRequest>,
|
||||
) -> AppResult<Json<Value>> {
|
||||
let profile = profile_svc::get_active_profile(&state.pool).await?;
|
||||
let profile = profile_svc::get_active_profile(&state.pool, game.as_str()).await?;
|
||||
let club = club_svc::get_club_by_profile(&state.pool, &profile.id).await?;
|
||||
|
||||
let updated = upgrade_svc::apply_chemistry_style(
|
||||
@@ -63,10 +65,11 @@ pub struct ChangePositionRequest {
|
||||
/// POST /collection/:owned_card_id/position — costs 500 coins.
|
||||
pub async fn post_change_position(
|
||||
State(state): State<AppState>,
|
||||
game: GameId,
|
||||
Path(owned_card_id): Path<String>,
|
||||
Json(req): Json<ChangePositionRequest>,
|
||||
) -> AppResult<Json<Value>> {
|
||||
let profile = profile_svc::get_active_profile(&state.pool).await?;
|
||||
let profile = profile_svc::get_active_profile(&state.pool, game.as_str()).await?;
|
||||
let club = club_svc::get_club_by_profile(&state.pool, &profile.id).await?;
|
||||
|
||||
let updated = upgrade_svc::change_position(
|
||||
@@ -97,10 +100,11 @@ pub struct ApplyTrainingRequest {
|
||||
/// POST /collection/:owned_card_id/training — applies a training boost (up to +3 OVR total).
|
||||
pub async fn post_apply_training(
|
||||
State(state): State<AppState>,
|
||||
game: GameId,
|
||||
Path(owned_card_id): Path<String>,
|
||||
Json(req): Json<ApplyTrainingRequest>,
|
||||
) -> AppResult<Json<Value>> {
|
||||
let profile = profile_svc::get_active_profile(&state.pool).await?;
|
||||
let profile = profile_svc::get_active_profile(&state.pool, game.as_str()).await?;
|
||||
let club = club_svc::get_club_by_profile(&state.pool, &profile.id).await?;
|
||||
|
||||
let updated =
|
||||
|
||||
Reference in New Issue
Block a user