slimnate / laser-beam

Error/app event logging platform
1 stars 0 forks source link

use hx-include for query params #29

Open slimnate opened 9 months ago

slimnate commented 9 months ago

While implementing the full tect searching with active search, I discovered the hx-include directive, which would be perfect for sending all of the query params for pagination/sorting/filtering/search with each new request.

The current method is to build a new url for each filter option, sort button, etc. on the server and include that via the render template. Using hx-include will be more performant and less error prone than building query strings on the server.

I can also use hx-values to supply values from the server for things like the sort buttons, since they need to have different values depending on the current sorting order (eg. if currently sorting a column by ascending order, the button should swap the order)