From 18cc9020f80b15a03371428f48e8b1b75b2f8e16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C2=96=C2=96AsTroLog?= Date: Sun, 29 Oct 2023 06:01:28 +0000 Subject: [PATCH] Edit list Wishlist --- .../Shared/NavMenu.razor | 27 +---------- .../Shared/NavMenu.razor.cs | 48 +++++++++---------- 2 files changed, 24 insertions(+), 51 deletions(-) diff --git a/ShoppingAssistantWebClient.Web/Shared/NavMenu.razor b/ShoppingAssistantWebClient.Web/Shared/NavMenu.razor index a88c985..f9d34c6 100644 --- a/ShoppingAssistantWebClient.Web/Shared/NavMenu.razor +++ b/ShoppingAssistantWebClient.Web/Shared/NavMenu.razor @@ -1,6 +1,5 @@ @inject NavigationManager Navigation -
@@ -28,7 +27,7 @@
- @foreach (var item in wishlist) + @foreach (var item in Wishlists) {
@item.Name
@@ -91,8 +90,6 @@ @code { - - private void RedirectToPage(string itemId) { var url = $"/chat/{itemId}"; Navigation.NavigateTo(url); @@ -107,28 +104,6 @@ } private void DeleteWishlist(string itemId) { - } - - - - private List wishlist; - - protected override async Task OnInitializedAsync() - { - - wishlist = new List - { - new Models.Wishlist {Id = "0", Name = "Gift for Jessica", Type="product", CreateById="0"}, - new Models.Wishlist {Id = "1", Name = "Secret Santa", Type="gift", CreateById="1"}, - new Models.Wishlist {Id = "2", Name = "Mark’s Birthday", Type="product", CreateById="2"}, - new Models.Wishlist {Id = "3", Name = "Garden tools", Type="product", CreateById="2"}, - new Models.Wishlist {Id = "4", Name = "Phone charger ", Type="product", CreateById="2"}, - new Models.Wishlist {Id = "5", Name = "Garden tools", Type="product", CreateById="2"} - }; - - } - - } diff --git a/ShoppingAssistantWebClient.Web/Shared/NavMenu.razor.cs b/ShoppingAssistantWebClient.Web/Shared/NavMenu.razor.cs index b31509d..7cb303a 100644 --- a/ShoppingAssistantWebClient.Web/Shared/NavMenu.razor.cs +++ b/ShoppingAssistantWebClient.Web/Shared/NavMenu.razor.cs @@ -1,25 +1,23 @@ - -using Microsoft.AspNetCore.Components; -using ShoppingAssistantWebClient.Web.Models; - -namespace ShoppingAssistantWebClient.Web.Pages; - -public partial class Wishlists : ComponentBase -{ -private List wishlist; - - protected override async Task OnInitializedAsync() - { - - wishlist = new List - { - new Models.Wishlist {Id = "0", Name = "Gift for Jessica", Type="product", CreateById="0"}, - new Models.Wishlist {Id = "1", Name = "Secret Santa", Type="gift", CreateById="1"}, - new Models.Wishlist {Id = "2", Name = "Mark’s Birthday", Type="product", CreateById="2"}, - new Models.Wishlist {Id = "3", Name = "Garden tools", Type="product", CreateById="2"}, - new Models.Wishlist {Id = "4", Name = "Phone charger ", Type="product", CreateById="2"}, - new Models.Wishlist {Id = "5", Name = "Garden tools", Type="product", CreateById="2"} - }; - - } -} +using Microsoft.AspNetCore.Components; +using ShoppingAssistantWebClient.Web.Models; + +namespace ShoppingAssistantWebClient.Web.Shared +{ + public partial class NavMenu : ComponentBase + { + + public List Wishlists = new() + { + new Wishlist {Id = "0", Name = "Gift for Jessica", Type="product", CreateById="0"}, + new Wishlist {Id = "1", Name = "Secret Santa", Type="gift", CreateById="1"}, + new Wishlist {Id = "2", Name = "Mark’s Birthday", Type="product", CreateById="2"} + }; + + protected override async Task OnInitializedAsync() + { + // Get data from Back-end + } + + } + +}