Skip to content

Commit 37ba919

Browse files
Fixed the shopping bag error.
1 parent 9517c72 commit 37ba919

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

client/src/components/routes/detail/productDetails.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ function ProductDetails(props) {
105105
const extractedProductId = history.location.search.split("product_id=")
106106
log.info(`[Product Detail] extractedProductId = ${JSON.stringify(extractedProductId)}, length = ${extractedProductId.length}`)
107107
if (extractedProductId.length === 2) {
108-
props.getDataViaAPI(SELECT_PRODUCT_DETAIL, PRODUCT_BY_ID_DATA_API + extractedProductId[1])
108+
props.getDataViaAPI(SELECT_PRODUCT_DETAIL, PRODUCT_BY_ID_DATA_API + extractedProductId[1], null, false)
109109
}
110110
} catch (e) {
111111
log.error('[Product Detail] selectedProduct is null')

client/src/components/routes/shoppingBag.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ function ShoppingBag(props) {
126126
}
127127

128128
const wannaShopBtnClick = () => {
129-
history.push(`/products?q=category=all::page=0,${MAX_PRODUCTS_PER_PAGE}`);
129+
history.push(`/products?q=page=0,${MAX_PRODUCTS_PER_PAGE}`);
130130
}
131131

132132
if (shoppingBagProducts.isLoading) {

client/src/hooks/useAddProductsToShoppingBag.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export function useAddProductsToShoppingBag(getDataViaAPIFunc) {
3333
idList = extractIdsFromObject(addToCart["productQty"])
3434

3535
if (idList.length > 0) {
36-
getDataViaAPIFunc(LOAD_SHOPPING_BAG_PRODUCTS, PRODUCT_BY_ID_DATA_API + idList.toString())
36+
getDataViaAPIFunc(LOAD_SHOPPING_BAG_PRODUCTS, PRODUCT_BY_ID_DATA_API + idList.toString(), null, false)
3737
return
3838
}
3939

server/common-data-service/src/main/java/com/ujjaval/ecommerce/commondataservice/config/CorsConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class CorsConfig implements WebMvcConfigurer
1111
{
1212
@Override
1313
public void addCorsMappings(CorsRegistry registry) {
14-
registry.addMapping("/**")
14+
registry.addMapping("/**").allowedOrigins("https://shoppers-ecom-app.herokuapp.com")
1515
.allowedMethods("GET", "POST");
1616
}
17-
}
17+
}

0 commit comments

Comments
 (0)