In this table I'm supposed to write a number and, using a custom function, I was able to sum all of the values.
I used the action on change at the textfield to add the item in the list of the app state. But if the user writes another value, creates another object, instead of updating the existing one.
You can see in the pictures that I typed 10 and 5, the sum was 15, then a changed the value of 10 for 100, it was supposed to be 105, but it came 115.
The object contains the drug_id and the price.