Loading PresentationLayer.Mvc/Areas/Admin/Controllers/GiftCardController.cs +0 −1 Original line number Diff line number Diff line Loading @@ -5,7 +5,6 @@ using Infrastructure.QueryObjects; using Microsoft.AspNetCore.Mvc; using PresentationLayer.Mvc.ActionFilters; using PresentationLayer.Mvc.Areas.Admin.Models; using PresentationLayer.Mvc.Models; namespace PresentationLayer.Mvc.Areas.Admin.Controllers; Loading PresentationLayer.Mvc/Areas/Admin/Controllers/ProductController.cs +1 −1 Original line number Diff line number Diff line Loading @@ -131,6 +131,6 @@ public class ProductController(IProductFacade productFacade, public async Task<IActionResult> Delete(int id) { var result = await productFacade.DeleteProductByIdAsync(id); return result ? RedirectToAction(nameof(Index)) : NotFound(); return result ? RedirectToAction(nameof(Index)) : View(Constants.Views.NotFound); } } PresentationLayer.Mvc/Areas/Admin/Controllers/UserController.cs +4 −1 Original line number Diff line number Diff line Loading @@ -96,7 +96,10 @@ public class UserController(IUserService userService, IMapper mapper) : Controll public async Task<IActionResult> Delete(int id) { var deleted = await userService.DeleteUserByIdAsync(id); if (!deleted) return BadRequest(); if (!deleted) { return View(Constants.Views.BadRequest); } return RedirectToAction(nameof(Index)); } Loading PresentationLayer.Mvc/Areas/Admin/Views/_ViewStart.cshtml +1 −1 Original line number Diff line number Diff line @{ Layout = "~/Shared/Views/_Layout.cshtml"; Layout = "~/Views/Shared/_Layout.cshtml"; } <link rel="stylesheet" href="~/css/admin.css" asp-append-version="true"/> PresentationLayer.Mvc/Areas/Customer/Controllers/CartController.cs +3 −4 Original line number Diff line number Diff line Loading @@ -5,7 +5,6 @@ using BusinessLayer.Services.Interfaces; using Microsoft.AspNetCore.Mvc; using PresentationLayer.Mvc.ActionFilters; using PresentationLayer.Mvc.Areas.Customer.Models; using PresentationLayer.Mvc.Models; namespace PresentationLayer.Mvc.Areas.Customer.Controllers; Loading @@ -18,7 +17,7 @@ public class CartController(ICartItemService cartItemService, IMapper mapper) : { if (!int.TryParse(User.FindFirstValue(ClaimTypes.Sid) ?? string.Empty, out var userId)) { return BadRequest(); return View(Constants.Views.BadRequest); } var cartItems = await cartItemService.GetCartItemsByUserIdAsync(userId); Loading @@ -30,7 +29,7 @@ public class CartController(ICartItemService cartItemService, IMapper mapper) : { if (!int.TryParse(User.FindFirstValue(ClaimTypes.Sid) ?? string.Empty, out var userId)) { return BadRequest(); return View(Constants.Views.BadRequest); } var success = await cartItemService.AddToCartAsync(mapper.Map<AddToCartDto>(addToCartViewModel), userId); Loading @@ -44,7 +43,7 @@ public class CartController(ICartItemService cartItemService, IMapper mapper) : { if (!int.TryParse(User.FindFirstValue(ClaimTypes.Sid) ?? string.Empty, out var userId)) { return BadRequest(); return View(Constants.Views.BadRequest); } var success = await cartItemService.DeleteCartItemByIdAsync(id, userId); Loading Loading
PresentationLayer.Mvc/Areas/Admin/Controllers/GiftCardController.cs +0 −1 Original line number Diff line number Diff line Loading @@ -5,7 +5,6 @@ using Infrastructure.QueryObjects; using Microsoft.AspNetCore.Mvc; using PresentationLayer.Mvc.ActionFilters; using PresentationLayer.Mvc.Areas.Admin.Models; using PresentationLayer.Mvc.Models; namespace PresentationLayer.Mvc.Areas.Admin.Controllers; Loading
PresentationLayer.Mvc/Areas/Admin/Controllers/ProductController.cs +1 −1 Original line number Diff line number Diff line Loading @@ -131,6 +131,6 @@ public class ProductController(IProductFacade productFacade, public async Task<IActionResult> Delete(int id) { var result = await productFacade.DeleteProductByIdAsync(id); return result ? RedirectToAction(nameof(Index)) : NotFound(); return result ? RedirectToAction(nameof(Index)) : View(Constants.Views.NotFound); } }
PresentationLayer.Mvc/Areas/Admin/Controllers/UserController.cs +4 −1 Original line number Diff line number Diff line Loading @@ -96,7 +96,10 @@ public class UserController(IUserService userService, IMapper mapper) : Controll public async Task<IActionResult> Delete(int id) { var deleted = await userService.DeleteUserByIdAsync(id); if (!deleted) return BadRequest(); if (!deleted) { return View(Constants.Views.BadRequest); } return RedirectToAction(nameof(Index)); } Loading
PresentationLayer.Mvc/Areas/Admin/Views/_ViewStart.cshtml +1 −1 Original line number Diff line number Diff line @{ Layout = "~/Shared/Views/_Layout.cshtml"; Layout = "~/Views/Shared/_Layout.cshtml"; } <link rel="stylesheet" href="~/css/admin.css" asp-append-version="true"/>
PresentationLayer.Mvc/Areas/Customer/Controllers/CartController.cs +3 −4 Original line number Diff line number Diff line Loading @@ -5,7 +5,6 @@ using BusinessLayer.Services.Interfaces; using Microsoft.AspNetCore.Mvc; using PresentationLayer.Mvc.ActionFilters; using PresentationLayer.Mvc.Areas.Customer.Models; using PresentationLayer.Mvc.Models; namespace PresentationLayer.Mvc.Areas.Customer.Controllers; Loading @@ -18,7 +17,7 @@ public class CartController(ICartItemService cartItemService, IMapper mapper) : { if (!int.TryParse(User.FindFirstValue(ClaimTypes.Sid) ?? string.Empty, out var userId)) { return BadRequest(); return View(Constants.Views.BadRequest); } var cartItems = await cartItemService.GetCartItemsByUserIdAsync(userId); Loading @@ -30,7 +29,7 @@ public class CartController(ICartItemService cartItemService, IMapper mapper) : { if (!int.TryParse(User.FindFirstValue(ClaimTypes.Sid) ?? string.Empty, out var userId)) { return BadRequest(); return View(Constants.Views.BadRequest); } var success = await cartItemService.AddToCartAsync(mapper.Map<AddToCartDto>(addToCartViewModel), userId); Loading @@ -44,7 +43,7 @@ public class CartController(ICartItemService cartItemService, IMapper mapper) : { if (!int.TryParse(User.FindFirstValue(ClaimTypes.Sid) ?? string.Empty, out var userId)) { return BadRequest(); return View(Constants.Views.BadRequest); } var success = await cartItemService.DeleteCartItemByIdAsync(id, userId); Loading