Skip to content

Commit

Permalink
rm default {} for metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
carlos-r-l-rodrigues committed Aug 6, 2024
1 parent f4dacb5 commit 148235e
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ export const completeCartWorkflow = createWorkflow(
unitPrice: item.raw_unit_price ?? item.unit_price,
isTaxInclusive: item.is_tax_inclusive,
quantity: item.raw_quantity ?? item.quantity,
metadata: item?.metadata ?? {},
taxLines: item.tax_lines || [],
adjustments: item.adjustments || [],
metadata: item?.metadata,
taxLines: item.tax_lines ?? [],
adjustments: item.adjustments ?? [],
})
})

Expand All @@ -113,10 +113,10 @@ export const completeCartWorkflow = createWorkflow(
})

const itemAdjustments = allItems
.map((item) => item.adjustments || [])
.map((item) => item.adjustments ?? [])
.flat(1)
const shippingAdjustments = shippingMethods
.map((sm) => sm.adjustments || [])
.map((sm) => sm.adjustments ?? [])
.flat(1)

const promoCodes = [...itemAdjustments, ...shippingAdjustments]
Expand Down

0 comments on commit 148235e

Please sign in to comment.