-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e1bfa89
commit 8667cb6
Showing
1 changed file
with
7 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }, | ||
}; | ||
} |