Skip to content

Commit 73cef41

Browse files
authored
Fixed API response issue (#131)
Cleaned up how we pull data product data
1 parent 60becd0 commit 73cef41

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-storefront",
3-
"version": "8.16.1",
3+
"version": "8.16.2",
44
"description": "Build and deploy e-commerce progressive web apps (PWAs) in record time.",
55
"module": "./index.js",
66
"license": "Apache-2.0",

src/mock-connector/addToCart.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
export default async function addToCart(product, quantity, req, res) {
2-
const { id, color, size } = product
1+
export default async function addToCart({ color, size, product }, req, res) {
2+
const { id, quantity } = product
33

44
console.log('product id: ', id)
55
console.log('color id: ', color || 'Not provided')
66
console.log('size id: ', size || 'Not provided')
7-
console.log('quantity ', quantity)
7+
console.log('quantity ', quantity || 1)
88

9-
return {}
9+
return { added: true, id }
1010
}

0 commit comments

Comments
 (0)