moltin / js-sdk

JavaScript & Node.js SDKs for the Elastic Path Commerce Cloud eCommerce API
http://documentation.elasticpath.com/
MIT License
173 stars 77 forks source link

Can't remove item from current Cart #86

Closed nclsmitchell closed 7 years ago

nclsmitchell commented 7 years ago

Hello,

When trying to remove an item from my current cart, I get the error: Invalid JSON: Unexpected token u in JSON at position 8

I am using the following code with import { gateway as MoltinGateway } from 'moltin' :

removeFromCart(id) {
    const Moltin = MoltinGateway({
        client_id: 'MY_CLIENT_ID'
    })
    Moltin.Cart.RemoveItem(id).then((cart) => {
        this.props.dispatch(updateCart(cart))
    })
}

It seems that a payload is send that shouldn't be here: {"data":undefined}

Do you know why this payload is send?

Thank you in advance!

ynnoj commented 7 years ago

@nclsmitchell Which version of the library are you using? I believe this should of been fixed in 2.2.2.

nclsmitchell commented 7 years ago

Ok I had the 2.1.0 version, it is now working.

Thank you!

ynnoj commented 7 years ago

@nclsmitchell npm install @moltin/sdk