Reverting change, it didn't work

This commit is contained in:
Frank
2023-10-04 20:07:45 -06:00
parent ab7a720899
commit 89bf68fe38

View File

@@ -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();