Reverting change, it didn't work
This commit is contained in:
@@ -29,27 +29,19 @@ const addRevalidateAndRedux = async (
|
|||||||
return getStaticProps;
|
return getStaticProps;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getStaticProps = async (props: any) =>
|
export const getStaticProps = wrapper.getStaticProps(
|
||||||
addRevalidateAndRedux(
|
(store) => async (context) => {
|
||||||
props,
|
store.dispatch(getPost.initiate(context?.params?.slug));
|
||||||
wrapper.getStaticProps((store) => async (context) => {
|
const [post] = await Promise.all(store.dispatch(getRunningQueriesThunk()));
|
||||||
store.dispatch(getPost.initiate(context?.params?.slug));
|
|
||||||
const [post] = await Promise.all(
|
|
||||||
store.dispatch(getRunningQueriesThunk())
|
|
||||||
);
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
props: {
|
props: {
|
||||||
post: post.data[0],
|
post: post.data[0],
|
||||||
},
|
},
|
||||||
revalidate: 60,
|
revalidate: 60,
|
||||||
};
|
};
|
||||||
})
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
// export const getStaticProps = wrapper.getStaticProps(
|
|
||||||
// (store) => async (context) => {}
|
|
||||||
// );
|
|
||||||
|
|
||||||
const Post = ({ post }: any) => {
|
const Post = ({ post }: any) => {
|
||||||
const dateUploaded = new Date(post.date).toDateString();
|
const dateUploaded = new Date(post.date).toDateString();
|
||||||
|
|||||||
Reference in New Issue
Block a user