diff --git a/src/components/QuickSearchForm/QuickSearchForm.vue b/src/components/QuickSearchForm/QuickSearchForm.vue index f6e0d7e..b4e8cfd 100644 --- a/src/components/QuickSearchForm/QuickSearchForm.vue +++ b/src/components/QuickSearchForm/QuickSearchForm.vue @@ -42,8 +42,8 @@ import { ref } from 'vue'; const router = useRouter(); -const props = withDefaults(defineProps<{ mode: 'dev' | 'prod' }>(), { - mode: 'prod', +const props = withDefaults(defineProps<{ baseUrlForRedirect: string }>(), { + baseUrlForRedirect: 'https://data-sources.pdap.io', }); const formSchema = [ @@ -85,13 +85,9 @@ function handleSubmit(values: { location: string; searchTerm: string }) { if (router.getRoutes().some((route) => route.path.includes('/search/'))) { router.push(`/search/${searchTerm}/${location}`); } else { - // Otherwise navigate via window - const baseUrl = - props.mode === 'prod' - ? 'https://data-sources.pdap.io' - : 'https://data-sources.pdap.dev'; - - window.location.assign(`${baseUrl}/search/${searchTerm}/${location}`); + window.location.assign( + `${props.baseUrlForRedirect}/search/${searchTerm}/${location}` + ); } } diff --git a/src/components/QuickSearchForm/__snapshots__/quick-search-form.spec.ts.snap b/src/components/QuickSearchForm/__snapshots__/quick-search-form.spec.ts.snap index c4eac1c..a5d7732 100644 --- a/src/components/QuickSearchForm/__snapshots__/quick-search-form.spec.ts.snap +++ b/src/components/QuickSearchForm/__snapshots__/quick-search-form.spec.ts.snap @@ -1,12 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`QuickSearchForm component > Renders a QuickSearchForm 1`] = ` -
If you have a question to answer, we may already know about helpful data in your area.
If you have a question to answer, we may already know about helpful data in your area. Learn more about the data here.