Skip to content

Commit

Permalink
chore: useRouteQuery
Browse files Browse the repository at this point in the history
  • Loading branch information
onmax committed Oct 3, 2024
1 parent 2d5652f commit 19f545f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
7 changes: 2 additions & 5 deletions app/pages/[parent]/[uid].vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@
import type { Content } from '@prismicio/client'
import { components } from '~/slices'
const route = useRoute()
// @ts-expect-error - `uid` is defined
const uid = route.params.uid
const uid = useRouteQuery('uid')
// TODO CHange to usePrismic
const { data: page } = usePrismicDocumentByUID<Content.PageDocument>('child_page', uid)
const { data: page } = usePrismicDocumentByUID<Content.PageDocument>('child_page', uid.value as string)
useHead({
title: page.value?.data.meta_title,
Expand Down
7 changes: 2 additions & 5 deletions app/pages/[uid].vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@
import type { Content } from '@prismicio/client'
import { components } from '~/slices'
const route = useRoute()
// @ts-expect-error - `uid` is defined
const uid = route.params.uid
const uid = useRouteQuery('uid')
// TODO CHange to usePrismic
const { data: page } = usePrismicDocumentByUID<Content.PageDocument>('page', uid)
const { data: page } = usePrismicDocumentByUID<Content.PageDocument>('page', uid.value as string)
useHead({
title: page.value?.data.meta_title,
Expand Down

0 comments on commit 19f545f

Please sign in to comment.