Skip to content

Commit

Permalink
fix: destructure route
Browse files Browse the repository at this point in the history
  • Loading branch information
Eein committed Nov 21, 2024
1 parent d0fb3ee commit b3ebb66
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pages/game/[slug].vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import { useRoute, createError } from '#imports'
import Loader from 'blocks/Loader/Loader.vue'
import { useGetLeaderboardBySlug } from '~/composables/api'
import LeaderboardInfo from '~/components/blocks/LeaderboardInfo/LeaderboardInfo.vue'
const route = useRoute()
const leaderboardSlug = route.params.slug as string
const {
params: { slug },
} = useRoute()
const leaderboardDetail = await useGetLeaderboardBySlug(leaderboardSlug)
const leaderboardDetail = await useGetLeaderboardBySlug(slug as string)
if (leaderboardDetail?.error?.status === 404) {
throw createError({
Expand Down

0 comments on commit b3ebb66

Please sign in to comment.