Added owning games and not willing to travel with them.

This commit is contained in:
2025-12-30 21:18:16 +01:00
parent ff88029a4b
commit 0c256846f6
45 changed files with 595 additions and 92 deletions

View File

@@ -1,10 +1,11 @@
use std::fmt::Display;
use async_trait::async_trait;
use gamenight_api_client_rs::{apis::default_api::game_post, models::AddGameRequestBody};
use inquire::{Confirm, Text};
use gamenight_api_client_rs::{apis::default_api::game_post, models::AddGameRequestBody, models::OwnGameRequestBody};
use gamenight_api_client_rs::apis::default_api::{locations_get, own_post};
use inquire::{Confirm, Select, Text};
use crate::flows::flow_helpers::LocationSelectData;
use crate::flows::own::Own;
use super::*;
@@ -25,13 +26,10 @@ impl<'a> Flow<'a> for AddGame {
let add_game_request = AddGameRequestBody {
name
};
game_post(&state.api_configuration, Some(add_game_request)).await?;
let game_id_response = game_post(&state.api_configuration, Some(add_game_request)).await?;
if let Some(owned) = Confirm::new("Do you own this game?").prompt_skippable()? {
if owned {
todo!()
}
}
let own_flow = Own::new(Uuid::parse_str(&game_id_response.game_id)?);
return self.continue_with(state, &own_flow).await;
}
Ok((FlowOutcome::Cancelled, state))
}