Skip to content

Commit

Permalink
Merge pull request #7412 from uktrade/bump_history
Browse files Browse the repository at this point in the history
TET-758: Only replace history if params has values
  • Loading branch information
santoshdasa12345 authored Dec 23, 2024
2 parents 3170151 + 9991168 commit f77b4d1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 29 deletions.
2 changes: 1 addition & 1 deletion assets/javascripts/lib/xhr.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const XHR = {
updateOutlet(res, params, win = window) {
this.injectResponseInHtml(res.data)

if (params) {
if (params && Object.keys(params).length > 0) {
const url = `?${queryString.stringify(params)}`
try {
history.replace(url, { data: res.data })
Expand Down
34 changes: 8 additions & 26 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"govuk-frontend": "^5.7.1",
"govuk-react": "^0.10.7",
"hawk": "^9.0.2",
"history": "^4.10.1",
"history": "^5.3.0",
"http-proxy-middleware": "^3.0.0",
"joi": "^17.13.1",
"lodash": "^4.17.21",
Expand Down Expand Up @@ -225,4 +225,4 @@
"semver": "7.5.2",
"tough-cookie": "4.1.3"
}
}
}

0 comments on commit f77b4d1

Please sign in to comment.