Skip to content

Commit

Permalink
Add payload
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvinkipruto committed Jul 24, 2023
1 parent e1bfa89 commit 8667cb6
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions apps/codeforafrica/src/lib/payload/data/index.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
import { getPageStaticProps } from "@/codeforafrica/lib";
// import api from "@/codeforafrica/lib/payload";
// import getPageProps from "@/codeforafrica/lib/payload/data/local";
import api from "@/codeforafrica/lib/payload";
import getPageProps from "@/codeforafrica/lib/payload/data/local";
// import { api } from "@/codeforafrica/lib/payload/data/rest";

// eslint-disable-next-line no-unused-vars
export default async function getPageServerSideProps(context, slug) {
// return getPageStaticProps({ slug });
// const props = await getPageProps(api, context);
// if (!props) {
// return { notFound: true };
// }
const props = await getPageProps(api, context);
if (!props) {
return { notFound: true };
}
const { props: staticProps } = await getPageStaticProps({ slug });
return {
props: { ...staticProps },
props: { ...staticProps, ...props },
};
}

0 comments on commit 8667cb6

Please sign in to comment.