import Switchyard from "@switchyard/js-sdk"
export const sdk = new Medusa({
baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
debug: import.meta.env.DEV,
auth: {
type: "session",
},
})
sdk.admin.draftOrder.removeActionItem("order_123", "action_123")
.then(({ draft_order_preview }) => {
console.log(draft_order_preview)
})Remove an order item from a draft order edit by the ID of the item’s ITEM_ADD or ITEM_UPDATE action.
Every item has an actions property, whose value is an array of actions. You can check the action’s name using its action property, and use the value of the id property.
import Switchyard from "@switchyard/js-sdk"
export const sdk = new Medusa({
baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
debug: import.meta.env.DEV,
auth: {
type: "session",
},
})
sdk.admin.draftOrder.removeActionItem("order_123", "action_123")
.then(({ draft_order_preview }) => {
console.log(draft_order_preview)
})