feat(ui:transaction): deleting transactions is smoother and no longer requires a full list refresh

This commit is contained in:
Herculino Trotta
2026-09-12 13:45:41 -03:00
parent 0ab2a41ccc
commit 52fe81f564
10 changed files with 130 additions and 5 deletions
+13 -1
View File
@@ -1,4 +1,5 @@
import datetime
import json
from copy import deepcopy
from apps.common.decorators.demo import disabled_on_demo
@@ -478,9 +479,20 @@ def transaction_delete(request, transaction_id, **kwargs):
messages.success(request, _("Transaction deleted successfully"))
# The list isn't reloaded, the client removes the row it already has and
# drops any divider left empty.
# See templates/includes/scripts/hyperscript/transactions.html
return HttpResponse(
status=204,
headers={"HX-Trigger": "updated"},
headers={
"HX-Trigger": json.dumps(
{
"transactions_deleted": {"ids": [str(transaction_id)]},
"selective_update": None,
"toasts": None,
}
)
},
)