@labdigital/commercetools-mock 2.62.0 → 2.62.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/repositories/helpers.ts +4 -6
package/dist/index.mjs
CHANGED
|
@@ -666,11 +666,11 @@ const getBusinessUnitKeyReference = (id, projectKey, storage) => {
|
|
|
666
666
|
typeId: "business-unit",
|
|
667
667
|
key: id.key
|
|
668
668
|
};
|
|
669
|
-
const
|
|
670
|
-
if (!
|
|
669
|
+
const resource = storage.getByResourceIdentifier(projectKey, id);
|
|
670
|
+
if (!resource?.key) throw new Error("No business-unit found for reference");
|
|
671
671
|
return {
|
|
672
672
|
typeId: "business-unit",
|
|
673
|
-
key:
|
|
673
|
+
key: resource.key
|
|
674
674
|
};
|
|
675
675
|
};
|
|
676
676
|
|