diff --git a/src/main.rs b/src/main.rs index eb2af0f..835ff19 100644 --- a/src/main.rs +++ b/src/main.rs @@ -58,14 +58,28 @@ fn main() -> Result<(), csv::Error> { // Combine source url let source_url = source_url_vec.join("/"); - + let sales_channel; + let id = record.subshop_id.unwrap(); + + if id.clone().eq("3") { // Lodner Geschmackswelten + sales_channel = "01963bc08ea57102bf347e203eaa9e63"; + } else if id.clone().eq("1") { // Lodner Gewürze + sales_channel = "01963bc08e987236ac5285e480769684"; + } else if id.clone().eq("2") { // Pfefferkontor + sales_channel = "01963bc08ea0717892a3c86b4eefbd06"; + } else if id.eq("4") { // Crazy Snack + sales_channel = "01963bc08eab702d852109975a1b0527"; + } else { // Set for all when no subshop id + sales_channel = ""; + } + records.push(Record{ source_url, target_url: Some(target_url), http_code: Some("301".to_string()), enabled: Some("1".to_string()), - query_params_handling: Some("".to_string()), - sales_channel_id: Some("".to_string()), + query_params_handling: Some("1".to_string()), // 1 to ignore query parameters + sales_channel_id: Some(sales_channel.to_string()), }) }