mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-09-13 05:12:03 +02:00
feat(ui:transaction): deleting transactions is smoother and no longer requires a full list refresh
This commit is contained in:
@@ -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,
|
||||
}
|
||||
)
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user