From 19343029651dd07bcacbd583d6ffea5e653d4861 Mon Sep 17 00:00:00 2001 From: Frank Elsinga Date: Sat, 20 Jul 2024 21:03:12 +0200 Subject: [PATCH] removed the prefix from the feedback --- server/main-api/src/feedback/post_feedback.rs | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/server/main-api/src/feedback/post_feedback.rs b/server/main-api/src/feedback/post_feedback.rs index 17711874d..352375c7c 100644 --- a/server/main-api/src/feedback/post_feedback.rs +++ b/server/main-api/src/feedback/post_feedback.rs @@ -32,26 +32,17 @@ pub async fn send_feedback( .content_type("text/plain") .body("Using this endpoint without accepting the privacy policy is not allowed"); }; - let (title_category, labels) = parse_request(&req_data); + let labels = parse_labels(&req_data); github::open_issue( - &format!("[{title_category}] {subject}", subject = req_data.subject), + &format!("{subject}", subject = req_data.subject), &req_data.body, labels, ) .await } -fn parse_request(req_data: &Json) -> (&str, Vec) { - let title_category = match req_data.category.as_str() { - "general" => "General", - "bug" => "Bug", - "feature" => "Feature", - "search" => "Search", - "entry" => "Entry", - _ => "Form", - }; - +fn parse_labels(req_data: &Json) -> Vec { let mut labels = vec!["webform".to_string()]; if req_data.deletion_requested { labels.push("delete-after-processing".to_string()); @@ -62,5 +53,5 @@ fn parse_request(req_data: &Json) -> (&str, Vec) { } _ => {} }; - (title_category, labels) + labels }