DEVELOPMENT ENVIRONMENT

~liljamo/deck-builder

74d86a9a0c73c9926efa0dda462c7dca2f4d71aa — Jonni Liljamo 1 year, 10 months ago f8676a8
feat(sdbclient): adhere to new game API responses
M sdbclient/src/api/game/mod.rs => sdbclient/src/api/game/mod.rs +1 -4
@@ 37,10 37,7 @@ pub fn create(api_address: String, token: String) -> ResponseCreateGame {
    resp.json().unwrap()
}

#[derive(Debug, Serialize, Deserialize)]
pub struct ResultAllForming {
    pub games: Vec<types::Game>,
}
pub type ResultAllForming = Vec<types::Game>;

#[derive(Debug, Serialize, Deserialize)]
#[serde(untagged)]

M sdbclient/src/api/game/types.rs => sdbclient/src/api/game/types.rs +2 -0
@@ 11,6 11,8 @@ use serde::{Deserialize, Serialize};
#[derive(Debug, Serialize, Deserialize)]
pub struct Game {
    pub id: String,
    pub created_at: String,
    pub updated_at: String,
    pub p1: String,
    pub p2: String,
    pub state: u8,

M sdbclient/src/plugins/menu/play/allformingcall.rs => sdbclient/src/plugins/menu/play/allformingcall.rs +1 -3
@@ 67,9 67,7 @@ pub(super) fn handle(
    if let Some(all_forming_call_response) = future::block_on(future::poll_once(&mut task.0)) {
        rtdmenu.waiting_for_all_forming_call = false;
        match all_forming_call_response.all_forming {
            ResponseAllForming::Valid(res) => {
                rtdmenu.all_forming_games = res.games;
            }
            ResponseAllForming::Valid(res) => rtdmenu.all_forming_games = res,
            ResponseAllForming::Error(error) => {
                console.send(PrintConsoleLine::new(
                    format!("Fetching all forming games faield, got error: '{}'", error).into(),