From f4500d18d9f486641710a596b828ea975ea2c7d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=99=E2=97=A6=20The=20Tablet=20=E2=9D=80=20GamerGirla?= =?UTF-8?q?ndCo=20=E2=97=A6=E2=9D=A7?= Date: Sat, 30 Dec 2023 16:06:10 -0500 Subject: [PATCH] refactor(pages): some typing tweaks --- layouts/default.vue | 8 +++++--- pages/user/[id].vue | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) 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("/"); }