Skip to content

Commit 35bd9f0

Browse files
authored
chore: add to TSDocs note about removing item from order edit (medusajs#12997)
1 parent ed92aaf commit 35bd9f0

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

packages/core/core-flows/src/order/workflows/order-edit/order-edit-update-item-quantity.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ export const orderEditUpdateItemQuantityWorkflowId =
7979
* This workflow updates the quantity of an existing item in an order's edit. It's used by the
8080
* [Update Order Item Quantity Admin API Route](https://docs.medusajs.com/api/admin#order-edits_postordereditsiditemsitemitem_id).
8181
*
82+
* You can also use this workflow to remove an item from an order by setting its quantity to `0`.
83+
*
8284
* You can use this workflow within your customizations or your own custom workflows, allowing you to update the quantity of an existing
8385
* item in an order's edit in your custom flow.
8486
*
@@ -98,7 +100,7 @@ export const orderEditUpdateItemQuantityWorkflowId =
98100
*
99101
* @summary
100102
*
101-
* Update the quantity of an existing order item in the order's edit.
103+
* Update or remove an existing order item's quantity in the order's edit.
102104
*/
103105
export const orderEditUpdateItemQuantityWorkflow = createWorkflow(
104106
orderEditUpdateItemQuantityWorkflowId,

packages/core/js-sdk/src/admin/order-edit.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@ export class OrderEdit {
188188
* [Update Item Quantity](https://docs.medusajs.com/api/admin#order-edits_postordereditsiditemsitemitem_id)
189189
* API route.
190190
*
191+
* You can also use this method to remove an item from an order by setting the `quantity` to `0`.
192+
*
191193
* @param id - The order edit's ID.
192194
* @param itemId - The item's ID in the order.
193195
* @param body - The data to edit in the item.

0 commit comments

Comments
 (0)