diff options
Diffstat (limited to 'webapp/src/services.rs')
-rw-r--r-- | webapp/src/services.rs | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/webapp/src/services.rs b/webapp/src/services.rs index 668530f..cd0c649 100644 --- a/webapp/src/services.rs +++ b/webapp/src/services.rs @@ -1,6 +1,10 @@ use anyhow::Context; use gloo_net::http::Request; -use protocol::{bridge_engine::{TableStatePlayerView, Bid}, Table, card::Card}; +use protocol::{ + bridge_engine::{Bid, TableStatePlayerView}, + card::Card, + Table, +}; use crate::utils::ok_json; @@ -16,22 +20,20 @@ pub async fn get_table_player_view( } pub async fn bid(table: Table, bid: Bid) -> Result<(), anyhow::Error> { - let response = - Request::post(&format!("/api/table/{}/bid", table.id)) - .json(&bid)? - .send() - .await - .context("submitting bid")?; + let response = Request::post(&format!("/api/table/{}/bid", table.id)) + .json(&bid)? + .send() + .await + .context("submitting bid")?; ok_json(response).await } pub async fn play(table: Table, card: Card) -> Result<(), anyhow::Error> { - let response = - Request::post(&format!("/api/table/{}/play", table.id)) - .json(&card)? - .send() - .await - .context("submitting play")?; + let response = Request::post(&format!("/api/table/{}/play", table.id)) + .json(&card)? + .send() + .await + .context("submitting play")?; ok_json(response).await } |