mirror of
https://github.com/marcusDenslow/terminalShop.git
synced 2026-10-25 18:08:45 +01:00
Three bugs fixed, two of them from the last commit, one of them has been long living. - the cart query in the ViewInit handler used user_id on cart_items, but that column does not exist, cart_items links to carts via cart_id. Fixed by first finding the users cart and then querying items by cart_id, which is how the reso of the cart handlers already do it. - GetViewInit was missing the json.Decode call entirely. so the response body was never parsed. This meant m.User was never set, blocking all cart syncs and address saves, and the cart always loaded empty. - after a successful order, the cart was never cleared locally even though the server deleted the cart items. this meant that the user had to quit and ssh back in to see the cart update. fixed by clreaing m.Cart, m.CartCursor and m.ShippingInfo in the CheckoutResultMsg success handler