server-lodaing-fix
This commit is contained in:
parent
336405c2e2
commit
417f2c6678
|
@ -1,12 +1,16 @@
|
|||
import type { PageProps } from './types'
|
||||
import type { PageContext } from '../renderer/types'
|
||||
|
||||
import { PRERENDERED_ARTICLES_COUNT } from '../components/Views/Home'
|
||||
import { apiClient } from '../graphql/client/core'
|
||||
|
||||
export const onBeforeRender = async (_pageContext: PageContext) => {
|
||||
const allAuthors = await apiClient.getAllAuthors()
|
||||
const homeShouts = await apiClient.getShouts({
|
||||
filters: { published: true },
|
||||
limit: PRERENDERED_ARTICLES_COUNT,
|
||||
})
|
||||
|
||||
const pageProps: PageProps = { allAuthors, seo: { title: '' } }
|
||||
const pageProps: PageProps = { homeShouts, seo: { title: '' } }
|
||||
|
||||
return {
|
||||
pageContext: {
|
||||
|
|
Loading…
Reference in New Issue
Block a user