@haus-tech/product-import-export-plugin 3.0.17 → 3.0.19
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.
|
@@ -251,6 +251,9 @@ let ProductImporter = class ProductImporter {
|
|
|
251
251
|
});
|
|
252
252
|
}
|
|
253
253
|
await this.fastImporter.initialize(ctx.channel);
|
|
254
|
+
const allVariantSkus = rows
|
|
255
|
+
.map((row) => row.variants.map((variant) => variant.sku))
|
|
256
|
+
.reduce((acc, val) => acc.concat(val), []);
|
|
254
257
|
for (const { product, variants } of rows) {
|
|
255
258
|
const productMainTranslation = this.getTranslationByCodeOrFirst(product.translations, ctx.languageCode);
|
|
256
259
|
const assetsToImport = (0, lodash_1.compact)(product.assetPaths.map((assetPath, idx) => {
|
|
@@ -280,7 +283,10 @@ let ProductImporter = class ProductImporter {
|
|
|
280
283
|
const foundVariants = await this.connection.getRepository(ctx, core_1.ProductVariant).findBy({
|
|
281
284
|
sku: (0, typeorm_1.In)(variantSkus),
|
|
282
285
|
});
|
|
283
|
-
|
|
286
|
+
const variantsWhereDeletedAtUndefined = foundVariants.filter((v) => {
|
|
287
|
+
return !v.deletedAt;
|
|
288
|
+
});
|
|
289
|
+
if (variantsWhereDeletedAtUndefined.length) {
|
|
284
290
|
checkExistingProduct = { id: foundVariants[0].productId };
|
|
285
291
|
}
|
|
286
292
|
}
|