Efficient way to update repeated item

Currently there is “x” icon and undo icon and it’s visibility is bind to data received from database. When every time user press “X” icon i will API will update to database and get new data from databased and refresh the page.
This will give a feel to user like app refreshing every time they press a button. So, trying to find there is any other better way to do this since i can’t create N number of page variable and attached to to each repeated icon.

In order to decide whats the most efficient way to do it, you need to know what kind of database you use, because each one works differently and calculates cost differently