Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

Minor fix - Import data

supportbcad5bb65d62
diff --git a/src/Business/Grand.Business.Catalog/Services/ExportImport/BrandImportDataObject.cs b/src/Business/Grand.Business.Catalog/Services/ExportImport/BrandImportDataObject.cs
index 0ff504afa..62775c93d 100644
--- a/src/Business/Grand.Business.Catalog/Services/ExportImport/BrandImportDataObject.cs
+++ b/src/Business/Grand.Business.Catalog/Services/ExportImport/BrandImportDataObject.cs
@@ -56,11 +56,11 @@ namespace Grand.Business.Catalog.Services.ExportImport
if (brand == null) brand = brandDto.MapTo<BrandDto, Brand>();
else brandDto.MapTo(brand);
+ if (!ValidBrand(brand)) return;
+
if (isNew) await _brandService.InsertBrand(brand);
else await _brandService.UpdateBrand(brand);
- if (!ValidBrand(brand)) return;
-
await UpdateBrandData(brandDto, brand);
}
diff --git a/src/Business/Grand.Business.Catalog/Services/ExportImport/CategoryImportDataObject.cs b/src/Business/Grand.Business.Catalog/Services/ExportImport/CategoryImportDataObject.cs
index 23797453f..b63024b1f 100644
--- a/src/Business/Grand.Business.Catalog/Services/ExportImport/CategoryImportDataObject.cs
+++ b/src/Business/Grand.Business.Catalog/Services/ExportImport/CategoryImportDataObject.cs
@@ -55,11 +55,11 @@ namespace Grand.Business.Catalog.Services.ExportImport
if (category == null) category = categoryDto.MapTo<CategoryDto, Category>();
else categoryDto.MapTo(category);
+ if (!ValidCategory(category)) return;
+
if (isNew) await _categoryService.InsertCategory(category);
else await _categoryService.UpdateCategory(category);
- if (!ValidCategory(category)) return;
-
await UpdateCategoryData(categoryDto, category);
}
diff --git a/src/Business/Grand.Business.Catalog/Services/ExportImport/CollectionImportDataObject.cs b/src/Business/Grand.Business.Catalog/Services/ExportImport/CollectionImportDataObject.cs
index 43d867e23..4f1205bee 100644
--- a/src/Business/Grand.Business.Catalog/Services/ExportImport/CollectionImportDataObject.cs
+++ b/src/Business/Grand.Business.Catalog/Services/ExportImport/CollectionImportDataObject.cs
@@ -56,11 +56,11 @@ namespace Grand.Business.Catalog.Services.ExportImport
if (collection == null) collection = collectionDto.MapTo<CollectionDto, Collection>();
else collectionDto.MapTo(collection);
+ if (!ValidCollection(collection)) return;
+
if (isNew) await _collectionService.InsertCollection(collection);
else await _collectionService.UpdateCollection(collection);
- if (!ValidCollection(collection)) return;
-
await UpdateCollectionData(collectionDto, collection);
}
diff --git a/src/Business/Grand.Business.Catalog/Services/ExportImport/ProductImportDataObject.cs b/src/Business/Grand.Business.Catalog/Services/ExportImport/ProductImportDataObject.cs
index 9edcc246d..4d10c1e8c 100644
--- a/src/Business/Grand.Business.Catalog/Services/ExportImport/ProductImportDataObject.cs
+++ b/src/Business/Grand.Business.Catalog/Services/ExportImport/ProductImportDataObject.cs
@@ -91,11 +91,11 @@ namespace Grand.Business.Catalog.Services.ExportImport
if (product == null) product = productDto.MapTo<ProductDto, Product>();
else productDto.MapTo(product);
+ if (!ValidProduct(product)) return;
+
if (isNew) await _productService.InsertProduct(product);
else await _productService.UpdateProduct(product);
- if (!ValidProduct(product)) return;
-
await UpdateProductData(productDto, product, isNew);
}