@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
- if (foundVariants.length) {
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haus-tech/product-import-export-plugin",
3
- "version": "3.0.17",
3
+ "version": "3.0.19",
4
4
  "description": "A Vendure plugin for importing and exporting products using a CSV file",
5
5
  "author": "Haus Tech",
6
6
  "repository": {