diff --git a/LittleShop/Areas/Admin/Controllers/ProductsController.cs b/LittleShop/Areas/Admin/Controllers/ProductsController.cs index 6d123b8..fe03970 100644 --- a/LittleShop/Areas/Admin/Controllers/ProductsController.cs +++ b/LittleShop/Areas/Admin/Controllers/ProductsController.cs @@ -252,7 +252,7 @@ public class ProductsController : Controller [HttpPost] [ValidateAntiForgeryToken] - public async Task ImportText(string textContent, IFormFile? file) + public async Task ImportText(string textContent, IFormFile? file, bool replaceAll = false) { string importText = textContent; @@ -277,7 +277,7 @@ public class ProductsController : Controller try { - var result = await _importService.ImportFromHumanTextAsync(importText); + var result = await _importService.ImportFromHumanTextAsync(importText, replaceAll); ViewData["ImportResult"] = result; return View("ImportResult", result); } diff --git a/LittleShop/Areas/Admin/Views/Products/ImportText.cshtml b/LittleShop/Areas/Admin/Views/Products/ImportText.cshtml index f50254a..19612f8 100644 --- a/LittleShop/Areas/Admin/Views/Products/ImportText.cshtml +++ b/LittleShop/Areas/Admin/Views/Products/ImportText.cshtml @@ -56,6 +56,18 @@ +
+
+ + +
+
+ Warning: This will permanently delete ALL existing product data! This action cannot be undone. +
+
+