File tree Expand file tree Collapse file tree 3 files changed +18
-12
lines changed
components/quickbooks/sources Expand file tree Collapse file tree 3 files changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -112,11 +112,13 @@ module.exports = {
112112 const webhookCompanyId = event . body . eventNotifications [ 0 ] . realmId ;
113113 if ( ! this . isValidSource ( event , webhookCompanyId ) ) {
114114 console . log ( "Skipping event from unrecognized source." ) ;
115- } else {
116- await Promise . all ( entities . map ( ( entity ) => {
117- entity . realmId = webhookCompanyId ;
118- return this . validateAndEmit ( entity ) ;
119- } ) ) ;
115+ return ;
116+ }
117+
118+ await Promise . all ( entities . map ( ( entity ) => {
119+ entity . realmId = webhookCompanyId ;
120+ return this . validateAndEmit ( entity ) ;
121+ } ) ) ;
120122 }
121123 } ,
122124} ;
Original file line number Diff line number Diff line change @@ -31,12 +31,14 @@ module.exports = {
3131 // (it would a hassle for the user to select every option if they wanted to emit everything)
3232 if ( this . namesToEmit . length > 0 && ! this . namesToEmit . includes ( entity . name ) ) {
3333 console . log ( `Entity Type '${ entity . name } ' not found in list of selected Entity Types` ) ;
34- } else if ( this . operationsToEmit . length > 0
34+ return ;
35+ }
36+ if ( this . operationsToEmit . length > 0
3537 && ! this . operationsToEmit . includes ( entity . operation ) ) {
3638 console . log ( `Operation '${ entity . operation } ' not found in list of selected Operations` ) ;
37- } else {
38- await this . processEvent ( entity ) ;
39- }
39+ return ;
40+ }
41+ await this . processEvent ( entity ) ;
4042 } ,
4143 } ,
4244} ;
Original file line number Diff line number Diff line change @@ -35,12 +35,14 @@ module.exports = {
3535 // if they wanted to emit everything)
3636 if ( entity . name !== sourceEntity ) {
3737 console . log ( `${ entity . name } webhook received and ignored, since it is not a Customer` ) ;
38- } else if ( this . operationsToEmit . length > 0
38+ return ;
39+ }
40+ if ( this . operationsToEmit . length > 0
3941 && ! this . operationsToEmit . includes ( entity . operation ) ) {
4042 console . log ( `Operation '${ entity . operation } ' not found in list of selected Operations` ) ;
41- } else {
42- await this . processEvent ( entity ) ;
43+ return ;
4344 }
45+ await this . processEvent ( entity ) ;
4446 } ,
4547 } ,
4648} ;
You can’t perform that action at this time.
0 commit comments