webapp/src/pages/allAuthors.page.server.ts

17 lines
397 B
TypeScript
Raw Normal View History

2023-02-17 09:21:02 +00:00
import type { PageContext } from '../renderer/types'
2024-02-04 11:25:21 +00:00
import type { PageProps } from './types'
2023-11-28 13:18:25 +00:00
import { apiClient } from '../graphql/client/core'
2023-02-17 09:21:02 +00:00
export const onBeforeRender = async (_pageContext: PageContext) => {
2023-12-26 23:28:26 +00:00
const allAuthors = await apiClient.getAllAuthors()
2023-02-17 09:21:02 +00:00
const pageProps: PageProps = { allAuthors, seo: { title: '' } }
2023-02-17 09:21:02 +00:00
return {
pageContext: {
pageProps,
},
2023-02-17 09:21:02 +00:00
}
}