fix: event edit and delete now use htmx.trigger() instead of .submit() / hx.trigger()
- form.submit() triggered standard GET submission with query params - hx.trigger() is not a valid function — htmx.trigger() is the correct API - Both edit save and delete now properly fire HTMX requests
This commit is contained in:
parent
c815e022b5
commit
b9721a9bab
1 changed files with 2 additions and 2 deletions
|
|
@ -27,7 +27,7 @@
|
|||
<div style="display: flex; gap: 0.5rem;">
|
||||
<button id="edit-toggle-btn" class="btn btn-secondary btn-sm" onclick="toggleEdit()" style="font-size: 0.75rem;">🔒 Edit</button>
|
||||
<button class="btn btn-secondary btn-sm" style="font-size: 0.75rem; color: #fca5a5; border-color: #7f1d1d;"
|
||||
onclick="if(confirm('Delete this event and all its receipts?')){hx.trigger('#delete-event','click')}">🗑️</button>
|
||||
onclick="if(confirm('Delete this event and all its receipts?')){htmx.trigger('#delete-event','click')}">🗑️</button>
|
||||
<div hx-delete="/events/{{.Event.ID}}" hx-target="body" hx-push-url="true" id="delete-event" style="display:none"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -71,7 +71,7 @@
|
|||
});
|
||||
btn.textContent = isEditing ? '🔒 Edit' : '🔓 Save';
|
||||
if (!isEditing) {
|
||||
document.getElementById('event-meta-form').submit();
|
||||
htmx.trigger('#event-meta-form', 'submit');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in a new issue