Skip to content

Commit

Permalink
perf(composables): resolve http call on the server itself
Browse files Browse the repository at this point in the history
  • Loading branch information
arunanshub committed Aug 1, 2024
1 parent 4f32384 commit 31a6a74
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions composables/useFetchQuestion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ export default async function (section: Ref<SectionWithoutId | undefined>) {
const {
data: question,
error,
pending,
} = await useLazyFetch(`/api/question/${msgid}`, { server: false })
status,
} = await useLazyFetch(`/api/question/${msgid}`)

const pending = computed(() => status.value === 'pending')

return { question, error, pending } as const
}

0 comments on commit 31a6a74

Please sign in to comment.