Closed natelaff closed 7 years ago
Well you seem to have fixed this by adding the missing data-url attribute to the delete link. This removes the cart item, but does not show the confirmation message or remove the row. have to refresh the page to see the cart item has been removed.
Ok, I got it. But I don't know why (as I'm just learning about ajax and jquery and all this). When you pass the view model back as JSON, you're doing this..
$('#cart-total').text(data.CartTotal);
$('#update-message').text(data.Message);
$('#cart-status').text(data.CartCount);
The issue I've found is that this is getting converted to camel case (I assume by JSON) and these values are undefined. Instead they must be
$('#cart-total').text(data.cartTotal);
$('#update-message').text(data.message);
$('#cart-status').text(data.cartCount);
So... maybe I'm just missing something where ASP.NET Core should be resolving all of this stuff, or its just a typo in the ShoppingCart/Index page. Either way should be addressed :)
This was resolved in https://github.com/aspnet/MusicStore/pull/762.
I can't get the remove from cart link to execute anything. What's missing?