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 => +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(),