everytime i check out some htmx source, it feels like it would be a complete nightmare to maintain at scale.
e.g.
hx-delete="/chat/{{ chat.id }}" hx-target="#chat-{{ chat.id }}" hx-swap="outerHTML"
e.g.
hx-delete="/chat/{{ chat.id }}" hx-target="#chat-{{ chat.id }}" hx-swap="outerHTML"
- send a DELETE request to /chat/chat.id
- the response is going to swap the content of the #chat-chat.id element
How could I implement an error flash message in case the delete fails in this case?
The server can include a couple response headers to override the placement of the message to not affect the existing page state
https://htmx.org/docs/#response-headers
This allows the error to either be added inline in the UI somewhere or (my preference) displayed as a toast by appending to the end of the <body>