Skip to content

Commit

Permalink
PM-698: update redirect logic (#284) (#286)
Browse files Browse the repository at this point in the history
  • Loading branch information
hero-dokane authored Nov 21, 2024
1 parent bb6b074 commit ac02c8f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion blocks/found-pet-report/found-pet-report.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { jsx, loadScript } from '../../scripts/scripts.js';
import { getConfigValue } from '../../scripts/configs.js';
import { isCanada } from '../../scripts/lib-franklin.js';

async function executeSubmit(block, requestBody) {
const reportLostEndpoint = await getConfigValue('found-pet-endpoint');
Expand All @@ -15,7 +16,8 @@ async function executeSubmit(block, requestBody) {
});

if (response.ok) {
window.location.href = '/lost-pet-protection/report-lost-found-pet/thank-you';
const urlPath = isCanada ? '/ca/lost-pet-protection/report-lost-found-pet/thank-you' : '/lost-pet-protection/report-lost-found-pet/thank-you';
window.location.href = urlPath;
} else {
form.classList.add('submission-message');
form.innerHTML = 'There was an error with your submission. Please try again.';
Expand Down

0 comments on commit ac02c8f

Please sign in to comment.