@@ -107,6 +107,12 @@ export class WAMonitoringService {
107107 } ;
108108 }
109109
110+ const findIntegration = await this . repository . integration . find ( key ) ;
111+ const integration = {
112+ ...findIntegration ,
113+ webhook_wa_business : `${ urlServer } /webhook/whatsapp/${ encodeURIComponent ( key ) } ` ,
114+ } ;
115+
110116 if ( value . connectionStatus . state === 'open' ) {
111117 this . logger . verbose ( 'instance: ' + key + ' - connectionStatus: open' ) ;
112118
@@ -128,6 +134,8 @@ export class WAMonitoringService {
128134 instanceData . instance [ 'apikey' ] = ( await this . repository . auth . find ( key ) ) ?. apikey ;
129135
130136 instanceData . instance [ 'chatwoot' ] = chatwoot ;
137+
138+ instanceData . instance [ 'integration' ] = integration ;
131139 }
132140
133141 instances . push ( instanceData ) ;
@@ -148,6 +156,8 @@ export class WAMonitoringService {
148156 instanceData . instance [ 'apikey' ] = ( await this . repository . auth . find ( key ) ) ?. apikey ;
149157
150158 instanceData . instance [ 'chatwoot' ] = chatwoot ;
159+
160+ instanceData . instance [ 'integration' ] = integration ;
151161 }
152162
153163 instances . push ( instanceData ) ;
@@ -189,6 +199,12 @@ export class WAMonitoringService {
189199 } ;
190200 }
191201
202+ const findIntegration = await this . repository . integration . find ( key ) ;
203+ const integration = {
204+ ...findIntegration ,
205+ webhook_wa_business : `${ urlServer } /webhook/whatsapp/${ encodeURIComponent ( key ) } ` ,
206+ } ;
207+
192208 if ( value . connectionStatus . state === 'open' ) {
193209 this . logger . verbose ( 'instance: ' + key + ' - connectionStatus: open' ) ;
194210
@@ -210,6 +226,8 @@ export class WAMonitoringService {
210226 instanceData . instance [ 'apikey' ] = ( await this . repository . auth . find ( key ) ) ?. apikey ;
211227
212228 instanceData . instance [ 'chatwoot' ] = chatwoot ;
229+
230+ instanceData . instance [ 'integration' ] = integration ;
213231 }
214232
215233 instances . push ( instanceData ) ;
@@ -230,6 +248,8 @@ export class WAMonitoringService {
230248 instanceData . instance [ 'apikey' ] = ( await this . repository . auth . find ( key ) ) ?. apikey ;
231249
232250 instanceData . instance [ 'chatwoot' ] = chatwoot ;
251+
252+ instanceData . instance [ 'integration' ] = integration ;
233253 }
234254
235255 instances . push ( instanceData ) ;
0 commit comments