web-installer/src/utils/buttons.js
// Sends test calls to every phone number provided in the "twilioPhoneNo" array.
Sends test calls to every phone number provided in the "twilioPhoneNo" array.
Sends test calls to every phone number provided in the " twilioPhoneNo " array .
function TestCallButton({
  disabled,
  twilioPhoneNumbersToDialValid,
  accountSid,
  authToken,
  twilioPhoneNumber,
}) {
  const onClick = async () => {
    twilioPhoneNumbersToDialValid.forEach(async (phoneNumberToDial) => {
      try {
        ToastsStore.info(`Calling number ${phoneNumberToDial}`, 5000);
        await testCall(accountSid, authToken, twilioPhoneNumber, phoneNumberToDial);
      } catch (e) {
        if (e.response) {
          ToastsStore.error(
            `Error in calling ${phoneNumberToDial}. Error: ${e.response.data.error}`,
            5000,
          );
        } else {
          ToastsStore.error(`Error in calling ${phoneNumberToDial}. Error: ${e.message}`, 5000);
        }
      }
    });
  };
  return (
    <Button color="primary" size="md" disabled={disabled} onClick={onClick}>
      Test
    </Button>
  );
}
function TestCallButton ( { disabled , twilioPhoneNumbersToDialValid , accountSid , authToken , twilioPhoneNumber , } ) { const onClick = async ( ) => { twilioPhoneNumbersToDialValid . forEach ( async ( phoneNumberToDial ) => { try { ToastsStore . info ( ` ${ phoneNumberToDial } ` , 5000 ) ; await testCall ( accountSid , authToken , twilioPhoneNumber , phoneNumberToDial ) ; } catch ( e ) { if ( e . response ) { ToastsStore . error ( ` ${ phoneNumberToDial } ${ e . response . data . error } ` , 5000 , ) ; } else { ToastsStore . error ( ` ${ phoneNumberToDial } ${ e . message } ` , 5000 ) ; } } } ) ; } ; return ( < Button color = "primary" size = "md" disabled = { disabled } onClick = { onClick } > 
      Test
     < / Button > ) ; }
Sends test calls to every phone number provided in the "twilioPhoneNo" array.
Sends test calls to every phone number provided in the " twilioPhoneNo " array .
// The request was made and the server responded with a status code // that falls out of the range of 2xx // Something happened in setting up the request that triggered an // Error