fix(medusa): Assign metadata when creating a draft order or creating a line item (#4662)

When creating a draft order or creating a line item via Postman, filled metadata is not saved, metadata remains null in the API response

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
zhangpengchen
2023-08-02 18:02:29 +02:00
committed by GitHub
parent 9c682ce288
commit fc6c9df035
3 changed files with 7 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
---
"@medusajs/medusa": patch
---
fix(medusa): Assign metadata when creating a draft order or creating a line item

View File

@@ -129,6 +129,7 @@ export default async (req, res) => {
allow_discounts: false,
unit_price: validated.unit_price || 0,
quantity: validated.quantity,
metadata: validated.metadata,
})
}

View File

@@ -334,6 +334,7 @@ class DraftOrderService extends TransactionBaseService {
allow_discounts: false,
unit_price: price,
quantity: item.quantity,
metadata: item.metadata,
})
})