Skip to content

Commit 83341b6

Browse files
author
Akarshit Wal
committed
(bugfix): not pre-rendering cart with shop
Signed-off-by: Akarshit Wal <akarshit.wal@mailchimp.com>
1 parent 41f4147 commit 83341b6

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

pages/[lang]/cart.js

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import Router from "translations/i18nRouter";
1616
import PageLoading from "components/PageLoading";
1717
import { withApollo } from "lib/apollo/withApollo";
1818

19-
import { locales } from "translations/config";
2019
import fetchPrimaryShop from "staticUtils/shop/fetchPrimaryShop";
2120
import fetchTranslations from "staticUtils/translations/fetchTranslations";
2221

@@ -177,12 +176,12 @@ class CartPage extends Component {
177176
}
178177

179178
/**
180-
* Static props for the cart route
179+
* Server props for the cart route
181180
*
182181
* @param {String} lang - the shop's language
183182
* @returns {Object} props
184183
*/
185-
export async function getStaticProps({ params: { lang } }) {
184+
export async function getServerSideProps({ params: { lang } }) {
186185
return {
187186
props: {
188187
...await fetchPrimaryShop(lang),
@@ -191,16 +190,4 @@ export async function getStaticProps({ params: { lang } }) {
191190
};
192191
}
193192

194-
/**
195-
* Static paths for the cart route
196-
*
197-
* @returns {Object} paths
198-
*/
199-
export async function getStaticPaths() {
200-
return {
201-
paths: locales.map((locale) => ({ params: { lang: locale } })),
202-
fallback: false
203-
};
204-
}
205-
206193
export default withApollo()(withStyles(styles)(withCart(inject("uiStore")(CartPage))));

0 commit comments

Comments
 (0)