Skip to content

Commit a668c94

Browse files
committed
Merge branch 'main' into polish/datastores
2 parents 24f8d57 + 6715263 commit a668c94

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

dist/index.html

Whitespace-only changes.

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
"typescript": "^4.2.4"
3636
},
3737
"dependencies": {
38-
"@foxy.io/node-api": "^1.0.0-beta.8",
3938
"@foxy.io/sdk": "^1.2.0",
4039
"body-parser": "^1.19.0",
4140
"express": "^4.17.1",

src/functions/shiptheory/DataStore.js

+7-4
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,14 @@ 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) => ({
127+
height: p.height,
127128
name: p.name,
128-
qtd: p.quantity,
129-
sku: p.code,
129+
qty: p.quantity,
130+
sku: p.code || `${transaction.id}-${i}`,
130131
value: p.price,
131-
weight: p.weight
132+
weight: p.weight,
133+
width: p.width
132134
}));
133135
const weight = items.reduce( (accum, curr) => curr.weight + accum);
134136
return {
@@ -137,6 +139,7 @@ class DataStore extends DataStoreBase {
137139
address_line_1: shipments[0].address1,
138140
city: shipments[0].city,
139141
country: shipments[0].country,
142+
email: transaction.customer_email,
140143
firstname: shipments[0].first_name,
141144
lastname: shipments[0].last_name,
142145
postcode: shipments[0].postal_code,

0 commit comments

Comments
 (0)