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.

Updated LowStockProducts method signature for optional parameters

supportfb14af7c5f95
diff --git a/src/Business/Grand.Business.Core/Interfaces/System/Reports/IProductsReportService.cs b/src/Business/Grand.Business.Core/Interfaces/System/Reports/IProductsReportService.cs
index 1c1bda533..48d6be919 100644
--- a/src/Business/Grand.Business.Core/Interfaces/System/Reports/IProductsReportService.cs
+++ b/src/Business/Grand.Business.Core/Interfaces/System/Reports/IProductsReportService.cs
@@ -14,6 +14,6 @@ namespace Grand.Business.Core.Interfaces.System.Reports
/// <param name="vendorId">Vendor identifier</param>
/// <param name="storeId">Store identifier</param>
/// <returns>Result</returns>
- Task<(IList<Product> products, IList<ProductsAttributeCombination> combinations)> LowStockProducts(string vendorId, string storeId);
+ Task<(IList<Product> products, IList<ProductsAttributeCombination> combinations)> LowStockProducts(string vendorId = "", string storeId = "");
}
}
diff --git a/src/Business/Grand.Business.System/Services/Reports/ProductsReportService.cs b/src/Business/Grand.Business.System/Services/Reports/ProductsReportService.cs
index 8453f205d..14d8dde2b 100644
--- a/src/Business/Grand.Business.System/Services/Reports/ProductsReportService.cs
+++ b/src/Business/Grand.Business.System/Services/Reports/ProductsReportService.cs
@@ -31,7 +31,7 @@ namespace Grand.Business.System.Services.Reports
/// <param name="vendorId">Vendor identifier</param>
/// <param name="storeId">Store identifier</param>
/// <returns>Result</returns>
- public virtual async Task<(IList<Product> products, IList<ProductsAttributeCombination> combinations)> LowStockProducts(string vendorId, string storeId)
+ public virtual async Task<(IList<Product> products, IList<ProductsAttributeCombination> combinations)> LowStockProducts(string vendorId = "", string storeId = "")
{
//Track inventory for product
//simple products
diff --git a/src/Web/Grand.Web.Admin/Controllers/HomeController.cs b/src/Web/Grand.Web.Admin/Controllers/HomeController.cs
index 06db8626c..b6699e85f 100644
--- a/src/Web/Grand.Web.Admin/Controllers/HomeController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/HomeController.cs
@@ -76,7 +76,7 @@ namespace Grand.Web.Admin.Controllers
model.OrdersPending = (await _orderReportService.GetOrderAverageReportLine(storeId: storeId, os: (int)OrderStatusSystem.Pending)).CountOrders;
model.AbandonedCarts = (await _mediator.Send(new GetCustomerQuery { StoreId = storeId, LoadOnlyWithShoppingCart = true })).Count();
- var lowStockProducts = await _productsReportService.LowStockProducts("", storeId);
+ var lowStockProducts = await _productsReportService.LowStockProducts(storeId: storeId);
model.LowStockProducts = lowStockProducts.products.Count + lowStockProducts.combinations.Count;
model.MerchandiseReturns = await _mediator.Send(new GetMerchandiseReturnCountQuery { RequestStatusId = 0, StoreId = storeId });
diff --git a/src/Web/Grand.Web.Admin/Controllers/ReportsController.cs b/src/Web/Grand.Web.Admin/Controllers/ReportsController.cs
index 32798c515..2483efa0d 100644
--- a/src/Web/Grand.Web.Admin/Controllers/ReportsController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/ReportsController.cs
@@ -546,7 +546,7 @@ namespace Grand.Web.Admin.Controllers
if (await _groupService.IsStaff(_workContext.CurrentCustomer))
storeId = _workContext.CurrentCustomer.StaffStoreId;
- var lowStockProducts = await _productsReportService.LowStockProducts("", storeId);
+ var lowStockProducts = await _productsReportService.LowStockProducts(storeId: storeId);
var models = new List<LowStockProductModel>();
//products