From e7bff5582cae43041f8c207d7830e4a52c1b79be Mon Sep 17 00:00:00 2001 From: Martin Heppner <105971399+martinheppner@users.noreply.github.com> Date: Sun, 15 Dec 2024 13:24:08 +0100 Subject: [PATCH] Return city as well, when provider = bahnzumberg --- src/views/Main/DetailReworked.js | 13 ++++++++++--- src/views/Start/Header.js | 1 - 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/views/Main/DetailReworked.js b/src/views/Main/DetailReworked.js index 7374c6c..1524bfc 100644 --- a/src/views/Main/DetailReworked.js +++ b/src/views/Main/DetailReworked.js @@ -556,11 +556,18 @@ const DetailReworked = (props) => { let imageUrl = ""; let description = ""; let URL = shareUrl(); + let target_url = ""; if (!!tour) { page_title = "Zuugle: " + tour.title + " (" + tour.provider_name + ")"; imageUrl = tour?.image_url && tour?.image_url.length > 0 && tour?.image_url; - description = - tour?.description && tour?.description.length > 0 && tour?.description; + description = tour?.description && tour?.description.length > 0 && tour?.description; + if (tour.provider==='bahnzumberg' && _city) { + target_url = tour.url + 'ab-' & _city; + } + else { + target_url = tour.url; + } + console.log("target_url = ", target_url) } return ( @@ -725,7 +732,7 @@ const DetailReworked = (props) => {
{ - window.open(tour?.url); + window.open(target_url); }} >
diff --git a/src/views/Start/Header.js b/src/views/Start/Header.js index 3fcb050..de29002 100644 --- a/src/views/Start/Header.js +++ b/src/views/Start/Header.js @@ -43,7 +43,6 @@ export default function Header({ const cityObj = allCities.find((e) => e.value === city); if (cityObj) { updateCapCity(cityObj.label); - // console.log("setting search params", city); searchParams.set("city", city); } }