Merge branch 'master' into 'production'
Merge 'added max 4 limit to fetch feed on in_english page' See merge request sahkoinsinoorikilta/vtmk/web2.0-frontend!67
This commit is contained in:
@@ -14,6 +14,10 @@ const eventOptions = {
|
|||||||
limit: 4,
|
limit: 4,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const feedOptions = {
|
||||||
|
limit: 4,
|
||||||
|
};
|
||||||
|
|
||||||
interface InitialProps {
|
interface InitialProps {
|
||||||
initialEvents: Event[];
|
initialEvents: Event[];
|
||||||
initialFeed: Post[];
|
initialFeed: Post[];
|
||||||
@@ -21,7 +25,7 @@ interface InitialProps {
|
|||||||
|
|
||||||
const InEnglishPage: NextPage<InitialProps> = ({ initialEvents, initialFeed }) => {
|
const InEnglishPage: NextPage<InitialProps> = ({ initialEvents, initialFeed }) => {
|
||||||
const eventResult = useFetchEvents({ initialData: initialEvents, options: eventOptions });
|
const eventResult = useFetchEvents({ initialData: initialEvents, options: eventOptions });
|
||||||
const feedResult = useFetchFeed({ initialData: initialFeed });
|
const feedResult = useFetchFeed({ initialData: initialFeed, options: feedOptions });
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -37,7 +41,7 @@ const InEnglishPage: NextPage<InitialProps> = ({ initialEvents, initialFeed }) =
|
|||||||
|
|
||||||
export const getStaticProps: GetStaticProps<InitialProps> = async () => {
|
export const getStaticProps: GetStaticProps<InitialProps> = async () => {
|
||||||
const initialEvents = await EventApi.getEvents(eventOptions);
|
const initialEvents = await EventApi.getEvents(eventOptions);
|
||||||
const initialFeed = await FeedApi.getFeed();
|
const initialFeed = await FeedApi.getFeed(feedOptions);
|
||||||
return {
|
return {
|
||||||
props: {
|
props: {
|
||||||
initialEvents,
|
initialEvents,
|
||||||
|
|||||||
Reference in New Issue
Block a user