1 parent
1185be31c4
commit
6680f69588
2 files changed
+34
-30
No files matched your search
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@medusajs/js-sdk": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
feat(js-sdk): add transferCart to sdk -> store -> cart
|
||||||
@@ -771,6 +771,35 @@ export class Store {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method updates the customer of a cart.
|
||||||
|
*
|
||||||
|
* @param id - The cart's ID.
|
||||||
|
* @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 fulfillment = {
|
public fulfillment = {
|
||||||
@@ -941,36 +970,6 @@ 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 = {
|
||||||
|
|||||||
Reference in new issue
Block a user