summaryrefslogtreecommitdiff
path: root/webapp/src/components/table.rs
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/src/components/table.rs')
-rw-r--r--webapp/src/components/table.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/webapp/src/components/table.rs b/webapp/src/components/table.rs
index c4f693e..a874a93 100644
--- a/webapp/src/components/table.rs
+++ b/webapp/src/components/table.rs
@@ -4,6 +4,8 @@ use protocol::bridge_engine::GameStatePlayerView;
use yew::prelude::*;
use crate::use_app_context;
use crate::components::Hand;
+use crate::utils::ok_json;
+use anyhow::Context;
#[function_component(OnlineTable)]
pub fn online_table(props: &OnlineTableProps) -> Html {
@@ -20,9 +22,8 @@ pub fn online_table(props: &OnlineTableProps) -> Html {
ctx.spawn_async(async move {
let response = Request::get(&format!("/api/table/{}", props.table.id))
.send()
- .await?;
- // info!("Got response: {:#?}", response.body());
- let table = response.json().await?;
+ .await.context("fetching table data")?;
+ let table = ok_json(response).await?;
table_state.set(Some(table));
Ok(())
});