fix(medusa-plugin-brightpearl): ignore goods out created if channel id not medusa

This commit is contained in:
Sebastian Rindom
2020-08-26 21:22:17 +02:00
parent e3332d4c47
commit a6a35204fe
2 changed files with 6 additions and 0 deletions

View File

@@ -12,4 +12,5 @@ yarn.lock
/services
/models
/subscribers
/utils

View File

@@ -576,6 +576,11 @@ class BrightpearlService extends BaseService {
const goodsOut = await client.warehouses.retrieveGoodsOutNote(id)
const order = await client.orders.retrieve(goodsOut.orderId)
// Only relevant for medusa orders check channel id
if (order.channelId !== parseInt(this.options.channel_id)) {
return
}
// Combine the line items that we are going to create a fulfillment for
const lines = Object.keys(goodsOut.orderRows)
.map((key) => {