fix(medusa-plugin-brightpearl): External ref split (#4295)

* order should be first part of external_ref

* add changeset

---------

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
Philip Korsholm
2023-06-15 19:41:44 +02:00
committed by GitHub
parent f98ba5bde8
commit 1d91fa4e08
2 changed files with 6 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
---
"medusa-plugin-brightpearl": patch
---
fix(brightpearl): split externalRef to get product id

View File

@@ -1705,7 +1705,7 @@ class BrightpearlService extends BaseService {
const { fulfillments: existingFulfillments, sales_channel } =
await this.orderService_
.withTransaction(transactionManager)
.retrieve(order.externalRef, {
.retrieve(order.externalRef.split(".")[0], {
relations: ["fulfillments", "sales_channel"],
})