wip: checkpoint multi-game core work
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
use crate::extractors::GameId;
|
||||
use axum::{extract::State, Json};
|
||||
use serde_json::{json, Value};
|
||||
|
||||
@@ -7,8 +8,8 @@ use crate::{
|
||||
services::{achievement as ach_svc, club as club_svc, profile as profile_svc},
|
||||
};
|
||||
|
||||
pub async fn get_achievements(State(state): State<AppState>) -> AppResult<Json<Value>> {
|
||||
let profile = profile_svc::get_active_profile(&state.pool).await?;
|
||||
pub async fn get_achievements(State(state): State<AppState>, game: GameId) -> AppResult<Json<Value>> {
|
||||
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 _ = ach_svc::check_and_unlock(&state.pool, &state.achievement_defs, &profile.id, &club.id).await;
|
||||
let achievements = ach_svc::list_with_status(&state.pool, &state.achievement_defs).await?;
|
||||
|
||||
Reference in New Issue
Block a user