diff --git a/server/src/handlers/http/users/dashboards.rs b/server/src/handlers/http/users/dashboards.rs index 6a558601e..89e47d614 100644 --- a/server/src/handlers/http/users/dashboards.rs +++ b/server/src/handlers/http/users/dashboards.rs @@ -57,7 +57,6 @@ pub async fn post(body: Bytes) -> Result { let dashboard_id = format!("{}.{}", &dashboard.user_id, Utc::now().timestamp_millis()); dashboard.dashboard_id = Some(dashboard_id.clone()); dashboard.version = Some(CURRENT_DASHBOARD_VERSION.to_string()); - DASHBOARDS.update(&dashboard); for tile in dashboard.tiles.iter_mut() { tile.tile_id = Some(format!( "{}.{}", @@ -65,6 +64,7 @@ pub async fn post(body: Bytes) -> Result { Utc::now().timestamp_micros() )); } + DASHBOARDS.update(&dashboard); let path = dashboard_path(&dashboard.user_id, &format!("{}.json", dashboard_id)); @@ -77,7 +77,7 @@ pub async fn post(body: Bytes) -> Result { Ok((web::Json(dashboard), StatusCode::OK)) } -pub async fn update(req: HttpRequest, body: Bytes) -> Result { +pub async fn update(req: HttpRequest, body: Bytes) -> Result { let dashboard_id = req .match_info() .get("dashboard_id") @@ -90,6 +90,15 @@ pub async fn update(req: HttpRequest, body: Bytes) -> Result Result Result { diff --git a/server/src/users/dashboards.rs b/server/src/users/dashboards.rs index c8c85d95e..5fd68cc2d 100644 --- a/server/src/users/dashboards.rs +++ b/server/src/users/dashboards.rs @@ -33,7 +33,6 @@ pub struct Tiles { name: String, pub tile_id: Option, description: String, - stream: String, query: String, order: Option, visualization: Visualization, @@ -57,7 +56,7 @@ pub struct CircularChartConfig { #[derive(Debug, Serialize, Deserialize, Default, Clone)] pub struct GraphConfig { x_key: String, - y_key: Vec, + y_keys: Vec, } #[derive(Debug, Serialize, Deserialize, Default, Clone)]