fix(core-flows): Allow return requests with no shipping (#8472)
Closes CC-265
This commit is contained in:
@@ -106,12 +106,8 @@ function prepareFulfillmentData({
|
||||
}
|
||||
|
||||
function extractReturnShippingOptionId({ orderPreview, orderReturn }) {
|
||||
if (!orderPreview.shipping_methods?.length) {
|
||||
return
|
||||
}
|
||||
|
||||
let returnShippingMethod
|
||||
for (const shippingMethod of orderPreview.shipping_methods) {
|
||||
for (const shippingMethod of orderPreview.shipping_methods ?? []) {
|
||||
const modifiedShippingMethod_ = shippingMethod as any
|
||||
if (!modifiedShippingMethod_.actions) {
|
||||
continue
|
||||
@@ -124,6 +120,11 @@ function extractReturnShippingOptionId({ orderPreview, orderReturn }) {
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
if (!returnShippingMethod) {
|
||||
return null
|
||||
}
|
||||
|
||||
return returnShippingMethod.shipping_option_id
|
||||
}
|
||||
|
||||
|
||||
@@ -50,6 +50,9 @@ function updateReturnItems(returnEntry, items) {
|
||||
const data = items.find((i) => i.details.reference_id === item.item_id)
|
||||
if (!data) return
|
||||
|
||||
console.log("ITEM: ", item)
|
||||
console.log("DATA: ", data)
|
||||
|
||||
const receivedQuantity = MathBN.add(
|
||||
item.received_quantity || 0,
|
||||
data.details.quantity
|
||||
|
||||
Reference in New Issue
Block a user