Skip to content

Commit cbfe506

Browse files
cdxkerskeptrunedev
authored andcommitted
bugfix: convert event_name string to the proper name for queries
1 parent 5ed15fb commit cbfe506

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

server/src/data/models.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7349,6 +7349,18 @@ impl EventNamesFilter {
73497349
_ => EventNamesFilter::View,
73507350
}
73517351
}
7352+
7353+
pub fn to_query_string(&self) -> String {
7354+
match self {
7355+
EventNamesFilter::ComponentClose => String::from("component_close"),
7356+
EventNamesFilter::ComponentOpen => String::from("component_open"),
7357+
EventNamesFilter::View => String::from("View"),
7358+
EventNamesFilter::FollowupQuery => String::from("site-followup_query"),
7359+
EventNamesFilter::Click => String::from("Click"),
7360+
EventNamesFilter::AddToCart => String::from("site-add_to_cart"),
7361+
EventNamesFilter::Checkout => String::from("site-checkout"),
7362+
}
7363+
}
73527364
}
73537365

73547366
#[derive(Debug, Serialize, Deserialize, ToSchema, Clone)]

server/src/operators/analytics_operator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1868,7 +1868,7 @@ pub async fn get_topic_queries_query(
18681868
let event_match_string = topic_events_filter
18691869
.event_names
18701870
.iter()
1871-
.map(|event_name| format!("event_name = '{}'", event_name))
1871+
.map(|event_name| format!("event_name = '{}'", event_name.to_query_string()))
18721872
.join(" OR ");
18731873

18741874
if topic_events_filter.inverted {

0 commit comments

Comments
 (0)