Skip to content

Commit

Permalink
still test pardot but dismiss any errors coming from it
Browse files Browse the repository at this point in the history
  • Loading branch information
tsubik committed Mar 26, 2021
1 parent 6abc649 commit 68f40a0
Showing 1 changed file with 20 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,24 +43,36 @@ const saveSurveyData = createThunkAction(

dispatch(setProcessing(true));

// still test pardot submission but do not handle errors
if (surveyData.subscription) {
fetch(USER_NEWSLETTER_URL, {
method: 'POST',
body: getNewsletterFormData(surveyData)
});
}

Promise.all([
fetch(
`${USER_SURVEY_SPREADSHEET_URL}?${spreadsheetQueryParams.join('&')}`
),
surveyData.subscription &&
fetch(USER_NEWSLETTER_URL, {
method: 'POST',
mode: 'no-cors',
body: getNewsletterFormData(surveyData)
})
)
// disabled pardot for now
/* surveyData.subscription &&
* fetch(USER_NEWSLETTER_URL, {
* method: 'POST',
* body: getNewsletterFormData(surveyData)
* }) */
])
.then(responses => {
/* eslint-disable-next-line no-console */
console.info('Modal download responses', responses);
if (responses[0].ok !== undefined && !responses[0].ok) {
throw new Error(responses[0].statusText);
}
if (responses[1].ok !== undefined && !responses[1].ok) {
if (
responses[1] &&
responses[1].ok !== undefined &&
!responses[1].ok
) {
throw new Error(responses[1].statusText);
}

Expand Down

0 comments on commit 68f40a0

Please sign in to comment.