feat(types, js-sdk): add updateCustomer to js-sdk (#10158)
what: - adds new `POST /store/cart/:id/customer` endpoint to js sdk
This commit is contained in:
1 parent
79088c8a3b
commit
495c381709
2 files changed
+32
No files matched your search
@@ -941,6 +941,36 @@ export class Store {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method updates the customer of a cart.
|
||||||
|
*
|
||||||
|
* @param id - The cart's ID.
|
||||||
|
* @param body - The data to update in the cart.
|
||||||
|
* @param query - Configure the fields to retrieve in the cart.
|
||||||
|
* @param headers - Headers to pass in the request.
|
||||||
|
* @returns The updated cart.
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* sdk.store.cart.transferCart("cart_123")
|
||||||
|
* .then(({ cart }) => {
|
||||||
|
* console.log(cart)
|
||||||
|
* })
|
||||||
|
*/
|
||||||
|
transferCart: async (
|
||||||
|
id: string,
|
||||||
|
query?: SelectParams,
|
||||||
|
headers?: ClientHeaders
|
||||||
|
) => {
|
||||||
|
return this.client.fetch<HttpTypes.StoreCartResponse>(
|
||||||
|
`/store/carts/${id}/customer`,
|
||||||
|
{
|
||||||
|
method: "POST",
|
||||||
|
headers,
|
||||||
|
query,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
public order = {
|
public order = {
|
||||||
|
|||||||
@@ -71,6 +71,8 @@ export interface StoreUpdateCart {
|
|||||||
promo_codes?: string[]
|
promo_codes?: string[]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface StoreUpdateCartCustomer {}
|
||||||
|
|
||||||
export interface StoreAddCartLineItem {
|
export interface StoreAddCartLineItem {
|
||||||
/**
|
/**
|
||||||
* The ID of the product variant to add to the cart.
|
* The ID of the product variant to add to the cart.
|
||||||
|
|||||||
Reference in new issue
Block a user