Swap two records in a Data Collection Variable and in the DB

Hi! I have a purchases list where I have buttons :arrow_up_small: and :arrow_down_small: to move records up and down. To render the list quickly, I update the Collection Variable (instantly) and send the request to the DB (it goes slower).

How to swap two adjacent records in the Variable and then in the DB? I tried this two nodes for the variable:

INSERT_ITEM_AT(data.PurchasesCollection, INDEX_OF(data.PurchasesCollection, current)-1, current);
WITHOUT_ITEM(data.PurchasesCollection, current)

But that’s just bring mess into list.
I didn’t update the DB, it would be the next step