diff --git a/packages/karbon/src/runtime/composables/front-page.ts b/packages/karbon/src/runtime/composables/front-page.ts index 22dd9eec..584a9f52 100644 --- a/packages/karbon/src/runtime/composables/front-page.ts +++ b/packages/karbon/src/runtime/composables/front-page.ts @@ -43,7 +43,9 @@ if (import.meta.hot) { }) } -export function getAllArticles(): AsyncData { +export function getAllArticles(): Promise & + AsyncData { + // @ts-expect-error unable to modal this type return useResourceList('article', { key: 'all', transform: (data) => { diff --git a/packages/karbon/src/runtime/composables/page-meta.ts b/packages/karbon/src/runtime/composables/page-meta.ts index 9bfc29fc..e9564171 100644 --- a/packages/karbon/src/runtime/composables/page-meta.ts +++ b/packages/karbon/src/runtime/composables/page-meta.ts @@ -133,7 +133,7 @@ export function setupPage({ type, seo = true }: SetupPage const authorId = meta.value.id onServerPrefetch(async () => { - const source = (await getAllArticles()).data.value ?? [] + const source = (await getAllArticles()) ?? [] const hasArticle = source.some(({ authors }) => { return authors.some((author) => author.id === authorId) })