Skip to content

Commit

Permalink
(bugfix): not pre-rendering cart with shop
Browse files Browse the repository at this point in the history
  • Loading branch information
Akarshit Wal committed Jan 29, 2021
1 parent 41f4147 commit 8fa6638
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions pages/[lang]/cart.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,12 @@ class CartPage extends Component {
}

/**
* Static props for the cart route
* Server props for the cart route
*
* @param {String} lang - the shop's language
* @returns {Object} props
*/
export async function getStaticProps({ params: { lang } }) {
export async function getServerSideProps({ params: { lang } }) {
return {
props: {
...await fetchPrimaryShop(lang),
Expand All @@ -191,16 +191,4 @@ export async function getStaticProps({ params: { lang } }) {
};
}

/**
* Static paths for the cart route
*
* @returns {Object} paths
*/
export async function getStaticPaths() {
return {
paths: locales.map((locale) => ({ params: { lang: locale } })),
fallback: false
};
}

export default withApollo()(withStyles(styles)(withCart(inject("uiStore")(CartPage))));

0 comments on commit 8fa6638

Please sign in to comment.