@labdigital/commercetools-mock 2.45.0 → 2.45.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.cjs +10 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +10 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/repositories/product/helpers.ts +18 -2
package/dist/index.cjs
CHANGED
|
@@ -5007,9 +5007,17 @@ var variantFromDraft = (context, storage, variantId, variant) => ({
|
|
|
5007
5007
|
key: variant?.key,
|
|
5008
5008
|
attributes: variant?.attributes ?? [],
|
|
5009
5009
|
prices: variant?.prices?.map((p) => priceFromDraft(context, storage, p)),
|
|
5010
|
-
assets: [],
|
|
5011
|
-
images: []
|
|
5010
|
+
assets: variant.assets?.map((a) => assetFromDraft(context, storage, a)) ?? [],
|
|
5011
|
+
images: variant.images ?? []
|
|
5012
5012
|
});
|
|
5013
|
+
var assetFromDraft = (context, storage, draft) => {
|
|
5014
|
+
const asset = {
|
|
5015
|
+
...draft,
|
|
5016
|
+
id: (0, import_uuid10.v4)(),
|
|
5017
|
+
custom: createCustomFields(draft.custom, context.projectKey, storage)
|
|
5018
|
+
};
|
|
5019
|
+
return asset;
|
|
5020
|
+
};
|
|
5013
5021
|
var priceFromDraft = (context, storage, draft) => ({
|
|
5014
5022
|
id: (0, import_uuid10.v4)(),
|
|
5015
5023
|
key: draft.key,
|