summaryrefslogtreecommitdiff
path: root/webapp/src/services.rs
diff options
context:
space:
mode:
authorKjetil Orbekk <kj@orbekk.com>2022-12-27 19:55:10 -0500
committerKjetil Orbekk <kj@orbekk.com>2022-12-27 19:58:45 -0500
commit21b7b57336cd3bf7bd328ada38c6069a48504f85 (patch)
treec0d47337f584403febcfc9ec365ea1ea810e782e /webapp/src/services.rs
parent3418ebf4db2375e0dfe2343da57d674e1f4fd57f (diff)
`cargo fmt`
Diffstat (limited to 'webapp/src/services.rs')
-rw-r--r--webapp/src/services.rs28
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
}