From 4a806270aa815dfeaac90e506ae8f248897b6953 Mon Sep 17 00:00:00 2001 From: enisn Date: Tue, 21 Dec 2021 17:05:22 +0300 Subject: [PATCH] Add Cart widget endpoint --- .../Components/Toolbar/Cart/CartWidgetViewComponent.cs | 2 +- .../EShopOnAbp.PublicWeb/Controllers/WidgetsController.cs | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/Components/Toolbar/Cart/CartWidgetViewComponent.cs b/apps/public-web/src/EShopOnAbp.PublicWeb/Components/Toolbar/Cart/CartWidgetViewComponent.cs index 838cafe4..b3b09e8d 100644 --- a/apps/public-web/src/EShopOnAbp.PublicWeb/Components/Toolbar/Cart/CartWidgetViewComponent.cs +++ b/apps/public-web/src/EShopOnAbp.PublicWeb/Components/Toolbar/Cart/CartWidgetViewComponent.cs @@ -12,7 +12,7 @@ namespace EShopOnAbp.PublicWeb.Components.Toolbar.Cart; [Widget( AutoInitialize = true, - RefreshUrl = "/Widgets/Basket", + RefreshUrl = "/Widgets/Cart", StyleTypes = new[] {typeof(CartWidgetStyleContributor)}, ScriptTypes = new[] {typeof(CartWidgetScriptContributor)} )] diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/Controllers/WidgetsController.cs b/apps/public-web/src/EShopOnAbp.PublicWeb/Controllers/WidgetsController.cs index c3f1098c..f55a5dfd 100644 --- a/apps/public-web/src/EShopOnAbp.PublicWeb/Controllers/WidgetsController.cs +++ b/apps/public-web/src/EShopOnAbp.PublicWeb/Controllers/WidgetsController.cs @@ -1,4 +1,5 @@ using EShopOnAbp.PublicWeb.Components.Basket; +using EShopOnAbp.PublicWeb.Components.Toolbar.Cart; using Microsoft.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc; @@ -13,4 +14,11 @@ public class WidgetsController : AbpController { return ViewComponent(typeof(BasketWidgetViewComponent)); } + + [HttpGet] + [Route("Cart")] + public IActionResult GetCartWidget() + { + return ViewComponent(typeof(CartWidgetViewComponent)); + } } \ No newline at end of file