refactor(pages): some typing tweaks
This commit is contained in:
parent
9378d56242
commit
f4500d18d9
@ -10,7 +10,9 @@
|
||||
|
||||
const col = token.value.colorText;
|
||||
|
||||
const { data: totals } = await useApiFetch<any>("/totals");
|
||||
const {
|
||||
data: { value: totals },
|
||||
} = await useApiFetch<{ stories: number; authors: number }>("/totals");
|
||||
|
||||
const collapsed = ref<boolean>(true);
|
||||
|
||||
@ -48,11 +50,11 @@
|
||||
<a-layout class="mlayout">
|
||||
<a-layout-header class="alayhead">
|
||||
<div style="display: flex; align-items: center; flex-wrap: wrap">
|
||||
<a-typography-title class="siteTitle"> Rockfic </a-typography-title>
|
||||
<div class="siteTitle">Rockfic</div>
|
||||
<div class="stat-block">
|
||||
<div>
|
||||
<a-typography-text> Band fiction that rocks </a-typography-text>
|
||||
<a-typography-text type="secondary"> With {{ totals?.stories ?? 0 }} stories by {{ totals?.authors ?? 0 }} authors </a-typography-text>
|
||||
<a-typography-text type="secondary"> With {{ totals?.stories || 0 }} stories by {{ totals?.authors || 0 }} authors </a-typography-text>
|
||||
</div>
|
||||
</div>
|
||||
<navbar />
|
||||
|
@ -9,7 +9,7 @@
|
||||
const rtr = useRoute();
|
||||
const { data: ses } = useAuth();
|
||||
|
||||
const { data: userInfo } = await useApiFetch<IUser>(`/user/${rtr.params.id}`);
|
||||
const { data: userInfo } = await useApiFetch<IUser | null>(`/user/${rtr.params.id}`);
|
||||
if (userInfo === null) {
|
||||
navigateTo("/");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user