Support preSubmit return input

This commit is contained in:
Chi Vinh Le
2018-03-21 13:54:10 +01:00
parent bd2fcf837a
commit f6e661090c
3 changed files with 14 additions and 5 deletions
@@ -15,8 +15,11 @@ export default class CheckSpamHook extends React.Component {
// If we haven't check the spam yet, make sure to include `checkSpam=true` in the mutation.
// Otherwise post comment without checking the spam.
if (!this.checked) {
input.checkSpam = true;
this.checked = true;
return {
...input,
checkSpam: true,
};
}
});
@@ -15,8 +15,11 @@ export default class CheckToxicityHook extends React.Component {
// If we haven't check the toxicity yet, make sure to include `checkToxicity=true` in the mutation.
// Otherwise post comment without checking the toxicity.
if (!this.checked) {
input.checkToxicity = true;
this.checked = true;
return {
...input,
checkToxicity: true,
};
}
});