Skip to content

Commit

Permalink
fix: pass event headers to note view route
Browse files Browse the repository at this point in the history
  • Loading branch information
logotip4ik committed Nov 4, 2024
1 parent fef9a87 commit c405fff
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pages/view/[link].vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
const route = useRoute();
const { site } = useRuntimeConfig().public;
const event = useRequestEvent();
const { data: note, error } = await useAsyncData('share', async () => {
// TODO: why res in unknown ?
const res = await $fetch<{ data: SharedNote }>(`/api/share/${route.params.link}`);
const res = await $fetch<{ data: SharedNote }>(`/api/share/${route.params.link}`, {
headers: event?.headers,
});
return res.data;
});
Expand Down

0 comments on commit c405fff

Please sign in to comment.