diff --git a/layouts/default.vue b/layouts/default.vue index d86e3ae..79b3632 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -10,7 +10,9 @@ const col = token.value.colorText; - const { data: totals } = await useApiFetch("/totals"); + const { + data: { value: totals }, + } = await useApiFetch<{ stories: number; authors: number }>("/totals"); const collapsed = ref(true); @@ -48,11 +50,11 @@
- Rockfic +
Rockfic
Band fiction that rocks - With {{ totals?.stories ?? 0 }} stories by {{ totals?.authors ?? 0 }} authors + With {{ totals?.stories || 0 }} stories by {{ totals?.authors || 0 }} authors
diff --git a/pages/user/[id].vue b/pages/user/[id].vue index 97ea58b..087402d 100644 --- a/pages/user/[id].vue +++ b/pages/user/[id].vue @@ -9,7 +9,7 @@ const rtr = useRoute(); const { data: ses } = useAuth(); - const { data: userInfo } = await useApiFetch(`/user/${rtr.params.id}`); + const { data: userInfo } = await useApiFetch(`/user/${rtr.params.id}`); if (userInfo === null) { navigateTo("/"); }