webapp/src/pages/expo/expo.page.server.ts
Ilya Y 784bb435c3
Feature/lint (#317)
* prettier

---------

Co-authored-by: Igor Lobanov <igor.lobanov@onetwotrip.com>
2023-11-14 18:10:00 +03:00

19 lines
559 B
TypeScript

import type { PageContext } from '../../renderer/types'
import type { PageProps } from '../types'
import { PRERENDERED_ARTICLES_COUNT } from '../../components/Views/Expo/Expo'
import { apiClient } from '../../utils/apiClient'
export const onBeforeRender = async (_pageContext: PageContext) => {
const expoShouts = await apiClient.getShouts({
filters: { excludeLayout: 'article' },
limit: PRERENDERED_ARTICLES_COUNT,
})
const pageProps: PageProps = { expoShouts, seo: { title: '' } }
return {
pageContext: {
pageProps,
},
}
}