From fe62f12fe5cad903070563d4529ffe48f6eae669 Mon Sep 17 00:00:00 2001 From: anant Date: Tue, 7 Jan 2025 16:16:31 +0530 Subject: [PATCH] bugfix for correlation and add title to struct --- src/correlation/mod.rs | 4 ++++ src/handlers/http/correlation.rs | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/correlation/mod.rs b/src/correlation/mod.rs index 9c1f6fb89..2befb5f07 100644 --- a/src/correlation/mod.rs +++ b/src/correlation/mod.rs @@ -150,6 +150,7 @@ pub enum CorrelationVersion { #[serde(rename_all = "camelCase")] pub struct CorrelationConfig { pub version: CorrelationVersion, + pub title: String, pub id: String, pub table_configs: Vec, pub join_config: JoinConfig, @@ -164,6 +165,7 @@ impl CorrelationConfig {} #[serde(rename_all = "camelCase")] pub struct CorrelationRequest { pub version: CorrelationVersion, + pub title: String, pub table_configs: Vec, pub join_config: JoinConfig, pub filter: Option, @@ -175,6 +177,7 @@ impl From for CorrelationConfig { fn from(val: CorrelationRequest) -> Self { Self { version: val.version, + title: val.title, id: get_hash(Utc::now().timestamp_micros().to_string().as_str()), table_configs: val.table_configs, join_config: val.join_config, @@ -189,6 +192,7 @@ impl CorrelationRequest { pub fn generate_correlation_config(self, id: String) -> CorrelationConfig { CorrelationConfig { version: self.version, + title: self.title, id, table_configs: self.table_configs, join_config: self.join_config, diff --git a/src/handlers/http/correlation.rs b/src/handlers/http/correlation.rs index df0e7a86e..1220aa245 100644 --- a/src/handlers/http/correlation.rs +++ b/src/handlers/http/correlation.rs @@ -143,8 +143,10 @@ pub async fn delete(req: HttpRequest) -> Result