Skip to content

Commit

Permalink
Merge pull request #1001 from City-of-Helsinki/UHF-X-fix_test_env
Browse files Browse the repository at this point in the history
Test/prod environment needs full path for this url. Fix.
  • Loading branch information
sundflux authored Jun 3, 2024
2 parents c466850 + 3e523c6 commit 4be2c6b
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,12 @@ const SearchMonitorContainer = () => {

// Send form to Hakuvahti subscribe service
const body = JSON.stringify(requestBody);
const response = await fetch('/hakuvahti/subscribe', {
const { host, pathname } = window.location;
let apiPath = `${pathname}/hakuvahti/subscribe`;
if (host.includes('docker.so')) {
apiPath = '/hakuvahti/subscribe';
}
const response = await fetch(apiPath, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Expand Down

0 comments on commit 4be2c6b

Please sign in to comment.