From e95c0fd03ab05df5ecd284aa8b81c96eb293ed5e Mon Sep 17 00:00:00 2001 From: Manuel Odelain <4610549+manuelodelain@users.noreply.github.com> Date: Fri, 8 Nov 2024 11:38:40 +0100 Subject: [PATCH] fix: dynamic route path from a static path --- pages/[...slug].vue | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pages/[...slug].vue b/pages/[...slug].vue index 94b29e9..0649a6c 100644 --- a/pages/[...slug].vue +++ b/pages/[...slug].vue @@ -13,7 +13,8 @@ definePageMeta({ // Roadiz handles the routing defineI18nRoute(false) -const { webResponse, item, error, headers, alternateLinks } = await useRoadizWebResponse() +const route = useRoute() +const { webResponse, item, error, headers, alternateLinks } = await useRoadizWebResponse(route.path) if (error) { showError(error) @@ -28,8 +29,6 @@ useCacheTags(headers?.[useRuntimeConfig().public.cacheTags?.key]) // Cache control useWebResponseCacheControl(webResponse) -const route = useRoute() - // Force redirect when web response URL is not matching current route path if (item?.url && item.url !== route.path) { await navigateTo({ path: item?.url }, { redirectCode: 301 })