Closed LostKobrakai closed 4 years ago
Please give the whole path for now. The reason we don't provide partial updates is because we never store all parameters. This is to avoid attacks where people would inflate LiveView sessions by sending really large payloads. So it is up to you to store the bits that you need.
I'm wondering how live_patch
works then? It seems to do fine with just ?page=1
.
That's because the browser is the one doing the URL manipulation. It is the one that merges ?page=1 to the current URL.
Environment
Actual behavior
When doing
{:noreply, push_patch(socket, to: "?page=1")}
in a liveview callback I get an raised error:Expected behavior
The same href works when used with
live_patch
in my pagination template so it should work forpush_patch
as well. Given query strings can't change the mounted liveview module I can't see the need for knowing the path and consulting the router.Additionally I'm wondering if there's merit in an api to only update a single key in the current query. E.g. when a page and search term are in the query just update the page without affecting the search term. That way abstracted components like paginations don't need to be aware of other query params.