I am creating a POS application for my bar, but whenever an item from the menu is selected, it appears in the order list on the right. However, when I try to update a specific order in the list by increasing or decreasing the quantity, the change is applied to a different item in the list. It seems like the updates are based on the position of the items in the list rather than targeting a specific item in the data structure.
I am using a custom data type, so the updates don’t interact with the database until the order is placed. This is important because the system will be used at the bar, and during peak times, relying heavily on the internet would slow down operations.
As you can see in the video, when the first item moves to the second or third position, changing the quantity only affects the item at index 0 in the list. I’m not sure how to fix this issue. Could you please help?