File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed
Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -455,19 +455,22 @@ export class ChatwootService {
455455 const values = this . getNumbers ( query ) ;
456456
457457 const fields = this . getSearchableFields ( ) ;
458- fields . forEach ( ( key , index ) => {
459- const queryOperator = fields . length - 1 === index ? null : 'OR' ;
460- payload . push ( {
461- attribute_key : key ,
462- filter_operator : 'contains' ,
463- values : values ,
464- query_operator : queryOperator ,
458+
459+ fields . forEach ( ( field , index1 ) => {
460+ values . forEach ( ( number , index2 ) => {
461+ const queryOperator = fields . length - 1 === index1 && values . length - 1 === index2 ? null : 'OR' ;
462+ payload . push ( {
463+ attribute_key : field ,
464+ filter_operator : 'contains' ,
465+ values : [ number ] ,
466+ query_operator : queryOperator ,
467+ } ) ;
465468 } ) ;
466469 } ) ;
467470
471+ this . logger . verbose ( 'Payload: ' + JSON . stringify ( payload ) ) ;
468472 return payload ;
469473 }
470-
471474 public async createConversation ( instance : InstanceDto , body : any ) {
472475 this . logger . verbose ( 'create conversation to instance: ' + instance . instanceName ) ;
473476 try {
You can’t perform that action at this time.
0 commit comments