Converted the Api to a Restful api.

This commit is contained in:
2026-01-22 22:51:03 +01:00
parent 79ba1e1b44
commit 9d3c5afb07
50 changed files with 2194 additions and 1939 deletions

View File

@@ -1,7 +1,7 @@
use std::fmt::Display;
use async_trait::async_trait;
use gamenight_api_client_rs::models::GamenightId;
use gamenight_api_client_rs::models::UserId;
use uuid::Uuid;
use super::{Flow, FlowOutcome, FlowResult, GamenightState};
@@ -22,7 +22,7 @@ impl Join {
#[async_trait]
impl<'a> Flow<'a> for Join {
async fn run(&self, state: &'a mut GamenightState) -> FlowResult<'a> {
let _ = state.api.join_post(Some(GamenightId{gamenight_id: self.gamenight_id.to_string()})).await?;
let _ = state.api.post_gamenight_participants(&self.gamenight_id.to_string(), Some(UserId{user_id: state.get_user_id()?.to_string()})).await?;
clear_screen::clear();
Ok((FlowOutcome::Successful, state))