NuxtN
Nuxt6mo ago
14 replies
bnason

useFetch undefined computed

How do I handle dependent values that may be undefined when using useFetch? For instance:
const { data: session } = await useLazyFetch('/api/session')
const { data: me } = await useLazyFetch(`/api/users/${session.value.userId}`)


Initially it will try to get /api/users/undefined
Was this page helpful?