Skip to content

Commit 6715263

Browse files
committed
fix(shiptheory): products without code need to have a sku
1 parent 245585a commit 6715263

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/functions/shiptheory/DataStore.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,11 @@ class DataStore extends DataStoreBase {
123123
// TODO: account for possible multiple shippings in a single transaction
124124
// grab data from each shipment and create a list of shipments to be sent to Shiptheory
125125
// for now it is simply assuming all items in embedded are part of the shipment
126-
const products = items.map(p => ({
126+
const products = items.map((p,i) => ({
127127
height: p.height,
128128
name: p.name,
129129
qty: p.quantity,
130-
sku: p.code,
130+
sku: p.code || `${transaction.id}-${i}`,
131131
value: p.price,
132132
weight: p.weight,
133133
width: p.width

0 commit comments

Comments
 (0)