Skip to content

Commit 546a126

Browse files
authored
Merge pull request #2156 from veteransaffairscanada/Feedback-not-empty
Feedback not empty
2 parents 45ae8c6 + 1c5a925 commit 546a126

File tree

2 files changed

+20
-16
lines changed

2 files changed

+20
-16
lines changed

components/feedbackBar.js

+10-8
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,16 @@ export class FeedbackBar extends Component {
117117
time: new Date().toUTCString()
118118
};
119119

120-
fetch("/submitComment", {
121-
body: JSON.stringify(payload),
122-
cache: "no-cache",
123-
headers: {
124-
"content-type": "application/json"
125-
},
126-
method: "POST"
127-
}).catch(err => Raven.captureException(err));
120+
if (payload.whatWentWrong || payload.howCanInfoBeMoreUseful) {
121+
fetch("/submitComment", {
122+
body: JSON.stringify(payload),
123+
cache: "no-cache",
124+
headers: {
125+
"content-type": "application/json"
126+
},
127+
method: "POST"
128+
}).catch(err => Raven.captureException(err));
129+
}
128130
};
129131

130132
sendFeedback = answer => {

pages/feedback.js

+10-8
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,16 @@ export class Feedback extends Component {
8686
time: new Date().toUTCString()
8787
};
8888

89-
fetch("/submitBetaFeedback", {
90-
body: JSON.stringify(payload),
91-
cache: "no-cache",
92-
headers: {
93-
"content-type": "application/json"
94-
},
95-
method: "POST"
96-
}).catch(err => Raven.captureException(err));
89+
if (payload.how_was_your_experience || payload.what_did_you_think) {
90+
fetch("/submitBetaFeedback", {
91+
body: JSON.stringify(payload),
92+
cache: "no-cache",
93+
headers: {
94+
"content-type": "application/json"
95+
},
96+
method: "POST"
97+
}).catch(err => Raven.captureException(err));
98+
}
9799
};
98100

99101
render() {

0 commit comments

Comments
 (0)