public async Task <IActionResult> OnPostRemoveToCartAsync(string cartItemId)
        {
            Cart = await _basketApi.GetCart("test");

            await _basketApi.DeleteItem(Cart.Username, Cart.Items.Find(i => i.ProductId == cartItemId));

            return(RedirectToPage());
        }
Esempio n. 2
0
        public async Task <IActionResult> OnPostRemoveToCartAsync(string cartItemId)
        {
            username = HttpContext.Session.GetString("username");
            Cart     = await _api.GetCart(username);

            await _api.DeleteItem(Cart.Username, Cart.Items.Find(i => i.ProductId == cartItemId));

            return(RedirectToPage());
        }