Closed fourwordsnz closed 4 months ago
I updated to Swell's latest version (4.0.9) but ran into TypeScript inconsistencies with docs and response.
Issue 1 – Attributes Values Key for Products & Product Variants
values
value
I'm having response generated via swell.products.variation() or via swell.products.get(slug)
swell.products.variation()
swell.products.get(slug)
Example:
Issue 2 – addItem: CartItem
Using swell.cart.addItem(product) and sending an object with keys below:
swell.cart.addItem(product)
{ product_id, quantity, variant_id, metadata }
With the update, now getting a type error, not assignable to CartItem. It now expects id to be included.
CartItem
id
Per docs, the object is what should be sent. Functionality wise there are no issues. Just a type issue. I can ignore it.
But is this expected or something on my end?
@fourwordsnz good catch! We have released v4.1.0 with a fix.
v4.1.0
I updated to Swell's latest version (4.0.9) but ran into TypeScript inconsistencies with docs and response.
Issue 1 – Attributes Values Key for Products & Product Variants
values
value
I'm having response generated via
swell.products.variation()
or viaswell.products.get(slug)
Example:
Issue 2 – addItem: CartItem
Using
swell.cart.addItem(product)
and sending an object with keys below:{ product_id, quantity, variant_id, metadata }
With the update, now getting a type error, not assignable to
CartItem
. It now expectsid
to be included.Per docs, the object is what should be sent. Functionality wise there are no issues. Just a type issue. I can ignore it.
But is this expected or something on my end?