Commit 9c7a914 1 parent cf5cf12 commit 9c7a914 Copy full SHA for 9c7a914
File tree 1 file changed +9
-7
lines changed
1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -123,20 +123,21 @@ export const getContactMessagingService = async (
123
123
select 1
124
124
from campaign_contact
125
125
where messaging_service_stick.cell = campaign_contact.cell
126
- and campaign_contact.id = 181403618
126
+ and campaign_contact.id = ?
127
127
)
128
128
and organization_id = ?
129
129
);
130
130
` ,
131
131
[ campaignContactId , parseInt ( organizationId ) ]
132
132
) ;
133
133
134
- if ( ! existingMessagingService )
135
- throw new Error ( `Unknown campaign contact ID ${ campaignContactId } ` ) ;
136
-
137
- // Return an existing match if there is one - this is the vast majorityu of cases
138
- const isRealService = existingMessagingService . messaging_service_sid !== null ;
139
- if ( isRealService ) return existingMessagingService ;
134
+ // Return an existing match if there is one - this is the vast majority of cases
135
+ if (
136
+ existingMessagingService &&
137
+ existingMessagingService . message_service_sid !== null
138
+ ) {
139
+ return existingMessagingService ;
140
+ }
140
141
141
142
const campaignContact = await r
142
143
. reader ( "campaign_contact" )
@@ -148,6 +149,7 @@ export const getContactMessagingService = async (
148
149
campaignContact . cell ,
149
150
parseInt ( organizationId )
150
151
) ;
152
+
151
153
return assignedService ;
152
154
} ;
153
155
You can’t perform that action at this time.
0 commit comments