webapp/src/pages/layoutShouts.page.server.ts
Igor Lobanov 75c3d5faea
expo pages (#111)
* layout pages

* lint

* code review, lint, build fix

* lint
2023-06-16 16:47:24 +02:00

19 lines
538 B
TypeScript

import type { PageContext } from '../renderer/types'
import { apiClient } from '../utils/apiClient'
import type { PageProps } from './types'
import { PRERENDERED_ARTICLES_COUNT } from './layoutShouts.page'
export const onBeforeRender = async (pageContext: PageContext) => {
const { layout } = pageContext.routeParams
const layoutShouts = await apiClient.getShouts({ filters: { layout }, limit: PRERENDERED_ARTICLES_COUNT })
const pageProps: PageProps = { layoutShouts }
return {
pageContext: {
pageProps
}
}
}