@@ -63,9 +63,7 @@ class AdminPhoneNumberInventory extends React.Component {
6363
6464 this . state = {
6565 buyNumbersDialogOpen : false ,
66- buyNumbersFormValues : {
67- addToOrganizationMessagingService : false
68- } ,
66+ buyNumbersFormValues : { } ,
6967 sortCol : "state" ,
7068 sortOrder : "asc" ,
7169 filters : { } ,
@@ -84,8 +82,7 @@ class AdminPhoneNumberInventory extends React.Component {
8482 . number ( )
8583 . required ( )
8684 . max ( window . MAX_NUMBERS_PER_BUY_JOB )
87- . min ( 1 ) ,
88- addToOrganizationMessagingService : yup . bool ( )
85+ . min ( 1 )
8986 } ) ;
9087 }
9188
@@ -117,23 +114,14 @@ class AdminPhoneNumberInventory extends React.Component {
117114 } ;
118115
119116 handleBuyNumbersSubmit = async ( ) => {
120- const {
121- areaCode,
122- limit,
123- addToOrganizationMessagingService
124- } = this . state . buyNumbersFormValues ;
125- await this . props . mutations . buyPhoneNumbers (
126- areaCode ,
127- limit ,
128- addToOrganizationMessagingService
129- ) ;
117+ const { areaCode, limit } = this . state . buyNumbersFormValues ;
118+ await this . props . mutations . buyPhoneNumbers ( areaCode , limit ) ;
130119
131120 this . setState ( {
132121 buyNumbersDialogOpen : false ,
133122 buyNumbersFormValues : {
134123 areaCode : null ,
135- limit : null ,
136- addToOrganizationMessagingService : false
124+ limit : null
137125 }
138126 } ) ;
139127 } ;
@@ -299,30 +287,6 @@ class AdminPhoneNumberInventory extends React.Component {
299287 name = "limit"
300288 { ...dataTest ( "limit" ) }
301289 />
302- { serviceName === "twilio" &&
303- serviceConfig . TWILIO_MESSAGE_SERVICE_SID &&
304- serviceConfig . TWILIO_MESSAGE_SERVICE_SID . length > 0 &&
305- ! this . props . data . organization . campaignPhoneNumbersEnabled && (
306- < Form . Field
307- name = "addToOrganizationMessagingService"
308- as = { props => (
309- < FormControlLabel
310- { ...props }
311- checked = { props . value }
312- label = "Add to this organization's Messaging Service"
313- control = { < Switch color = "primary" /> }
314- />
315- ) }
316- style = { {
317- marginTop : 30
318- } }
319- onToggle = { ( _ , toggled ) => {
320- this . handleFormChange ( {
321- addToOrganizationMessagingService : toggled
322- } ) ;
323- } }
324- />
325- ) }
326290 </ div >
327291 < div style = { inlineStyles . dialogActions } >
328292 < Button
@@ -507,23 +471,17 @@ const queries = {
507471} ;
508472
509473const mutations = {
510- buyPhoneNumbers : ownProps => (
511- areaCode ,
512- limit ,
513- addToOrganizationMessagingService
514- ) => ( {
474+ buyPhoneNumbers : ownProps => ( areaCode , limit ) => ( {
515475 mutation : gql `
516476 mutation buyPhoneNumbers(
517477 $organizationId: ID!
518478 $areaCode: String!
519479 $limit: Int!
520- $addToOrganizationMessagingService: Boolean
521480 ) {
522481 buyPhoneNumbers(
523482 organizationId: $organizationId
524483 areaCode: $areaCode
525484 limit: $limit
526- addToOrganizationMessagingService: $addToOrganizationMessagingService
527485 ) {
528486 id
529487 }
@@ -532,8 +490,7 @@ const mutations = {
532490 variables : {
533491 organizationId : ownProps . params . organizationId ,
534492 areaCode,
535- limit,
536- addToOrganizationMessagingService
493+ limit
537494 } ,
538495 refetchQueries : ( ) => [ "getOrganizationData" ]
539496 } ) ,
0 commit comments