Skip to content

Commit

Permalink
FIX Clear filter from url state
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Sep 11, 2023
1 parent c9913dc commit 45a9949
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion client/dist/js/bundle.js

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions client/src/legacy/GridField.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,17 +224,20 @@ $.entwine('ss', function($) {
*/
buildURLString: function(url) {
const link = [window.location.origin, url].join('/');
const params = [window.location.search, (new URL(link)).searchParams.toString()].join('&').substring(1);
const params = (new URL(link)).searchParams.toString();
const newrequest = [];
const reqString = [];
// remove empty values
params.split('&').forEach(param => {
const newVal = param.split('=');
if (newVal[0] === '') {
return;
}
newrequest[newVal[0]] = newVal[1] ? newVal[1] : '';
});
Object.keys(newrequest).forEach(param => {
reqString.push([param, newrequest[param]].join('='));
});

return reqString;
}
});
Expand Down

0 comments on commit 45a9949

Please sign in to comment.