Merged in feat/BOOK-434-users-should-redirect-to- (pull request #3154)
* feat(BOOK-434): Moved redirect to middleware layer * feat(BOOK-434): Updated to handle no filters available scenario Approved-by: Erik Tiekstra
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { notFound, redirect } from "next/navigation"
|
||||
import { notFound } from "next/navigation"
|
||||
import { Suspense } from "react"
|
||||
|
||||
import {
|
||||
@@ -69,11 +69,6 @@ export default async function DestinationCityPage({
|
||||
|
||||
const activeSeoFilter = getActiveSeoFilter(seo_filters, filterFromUrl)
|
||||
|
||||
if (filterFromUrl && !activeSeoFilter) {
|
||||
const updatedPathname = pathname.replace(`/${filterFromUrl}`, "")
|
||||
return redirect(`${updatedPathname}${isMapView ? "?view=map" : ""}`)
|
||||
}
|
||||
|
||||
const allHotels = await getHotelsByCityIdentifier(cityIdentifier)
|
||||
const hotelFilters = getFiltersFromHotels(allHotels, lang)
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { notFound, redirect } from "next/navigation"
|
||||
import { notFound } from "next/navigation"
|
||||
import { Suspense } from "react"
|
||||
|
||||
import {
|
||||
@@ -70,11 +70,6 @@ export default async function DestinationCountryPage({
|
||||
|
||||
const activeSeoFilter = getActiveSeoFilter(seo_filters, filterFromUrl)
|
||||
|
||||
if (filterFromUrl && !activeSeoFilter) {
|
||||
const updatedPathname = pathname.replace(`/${filterFromUrl}`, "")
|
||||
return redirect(`${updatedPathname}${isMapView ? "?view=map" : ""}`)
|
||||
}
|
||||
|
||||
const [allHotels, allCities] = await Promise.all([
|
||||
getHotelsByCountry(destination_settings.country),
|
||||
getDestinationCityPagesByCountry(destination_settings.country),
|
||||
|
||||
Reference in New Issue
Block a user