@ns8/ns8-shopify-switches
Advanced tools
Comparing version 1.0.15 to 1.0.16
@@ -10,10 +10,24 @@ "use strict"; | ||
const webhookList = await client.webhook.list(); | ||
const deleted = []; | ||
webhookList.forEach(async (webhook) => { | ||
deleted.push(webhook); | ||
await client.webhook.delete(webhook.id); | ||
}); | ||
const response = await client.webhook.create({ | ||
const orderTransaction = await client.webhook.create({ | ||
topic: 'order_transactions/create', | ||
address: data.webhooks.createOrder, | ||
}); | ||
return response; | ||
const shopUpdate = await client.webhook.create({ | ||
topic: 'shop/update', | ||
address: data.webhooks.updateShop, | ||
}); | ||
return { | ||
webhooks: { | ||
deleted, | ||
created: { | ||
orderTransaction, | ||
shopUpdate, | ||
}, | ||
}, | ||
}; | ||
}; | ||
@@ -20,0 +34,0 @@ } |
{ | ||
"name": "@ns8/ns8-shopify-switches", | ||
"version": "1.0.15", | ||
"version": "1.0.16", | ||
"description": "Custom switches for the shopify integration", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
11812
152