Skip to content

Commit

Permalink
fix: dynamic route path from a static path
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelodelain committed Nov 8, 2024
1 parent 45c0e72 commit e95c0fd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pages/[...slug].vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ definePageMeta({
// Roadiz handles the routing
defineI18nRoute(false)
const { webResponse, item, error, headers, alternateLinks } = await useRoadizWebResponse<RoadizNodesSources>()
const route = useRoute()
const { webResponse, item, error, headers, alternateLinks } = await useRoadizWebResponse<RoadizNodesSources>(route.path)
if (error) {
showError(error)
Expand All @@ -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 })
Expand Down

0 comments on commit e95c0fd

Please sign in to comment.