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:
@@ -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 = {
|
||||
|
||||
@@ -71,6 +71,8 @@ export interface StoreUpdateCart {
|
||||
promo_codes?: string[]
|
||||
}
|
||||
|
||||
export interface StoreUpdateCartCustomer {}
|
||||
|
||||
export interface StoreAddCartLineItem {
|
||||
/**
|
||||
* The ID of the product variant to add to the cart.
|
||||
@@ -104,7 +106,7 @@ export interface StoreAddCartShippingMethods {
|
||||
option_id: string
|
||||
/**
|
||||
* Data useful for the associated fulfillment provider.
|
||||
*
|
||||
*
|
||||
* Learn more in [this documentation](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#data-property).
|
||||
*/
|
||||
data?: Record<string, unknown>
|
||||
|
||||
Reference in New Issue
Block a user