fix: move transfer cart under cart (#10175)

made a whoopsie!
This commit is contained in:
Riqwan Thamir
2024-11-20 11:12:49 +00:00
committed by GitHub
parent 1185be31c4
commit 6680f69588
2 changed files with 34 additions and 30 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"@medusajs/js-sdk": patch
---
feat(js-sdk): add transferCart to sdk -> store -> cart
+29 -30
View File
@@ -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 = {
@@ -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 = {