Exemplo n.º 1
0
 .then((response) => {
   if (isUntrustedUser(response)) {
     // We have re-sent & verified the code, show success
     dispatch(showFlashMessage(settings.flashMessages.verificationResent, 'success'));
   } else {
     // All other errors
     dispatch(showFlashMessage(settings.flashMessages.genericError, 'error'));
   }
   // Set petition as published
   dispatch(publishedPetition(response.data));
 }).catch(() => dispatch(
Exemplo n.º 2
0
 .then((response) => {
   if (isUntrustedUser(response)) {
     // We have re-sent & verified the code, show success
     dispatch(showFlashMessage(settings.flashMessages.verificationResent, 'success'));
   } else {
     // All other errors
     dispatch(showFlashMessage(settings.flashMessages.genericError, 'error'));
   }
   // Set loading state
   dispatch(supportedPetition(trustData.petition));
 }).catch(() => dispatch(
Exemplo n.º 3
0
const publishPetitionErrors = (id, response, dispatch) => {
  if (isUntrustedUser(response)) {
    // Change route to publish trust confirmation
    dispatch(push(`/trust/publish/${id}/confirm`));
  } else if (isInvalidVerification(response)) {
    // When the verification code is invalid
    dispatch(showFlashMessage(settings.flashMessages.invalidVerificationError, 'error'));
  } else {
    // All other errors
    dispatch(showFlashMessage(settings.flashMessages.genericError, 'error'));
  }
};