Skip to content

Commit

Permalink
Make sure existing get params get replaced properly
Browse files Browse the repository at this point in the history
  • Loading branch information
flack committed Jan 4, 2025
1 parent 3bd09c2 commit c41cb10
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion static/org.openpsa.core/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ $(document).ready(function() {
});

if (!$.isEmptyObject(filter_values)) {
$(this).closest('form').prop('action', $(this).closest('form').prop('action') + '?' + $.param(filter_values));
const url = new URL($(this).closest('form').prop('action'));
for (const [key, value] of Object.entries(filter_values)) {
url.searchParams.set(key, value);
}
$(this).closest('form').prop('action', url.toString());
}
$(this).closest('form').submit();
});
Expand Down

0 comments on commit c41cb10

Please sign in to comment.