mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-24 17:38:40 -06:00
Fix for contats find payload
This commit is contained in:
parent
b09546577a
commit
b995cdfc32
@ -455,19 +455,22 @@ export class ChatwootService {
|
|||||||
const values = this.getNumbers(query);
|
const values = this.getNumbers(query);
|
||||||
|
|
||||||
const fields = this.getSearchableFields();
|
const fields = this.getSearchableFields();
|
||||||
fields.forEach((key, index) => {
|
|
||||||
const queryOperator = fields.length - 1 === index ? null : 'OR';
|
fields.forEach((field, index1) => {
|
||||||
payload.push({
|
values.forEach((number, index2) => {
|
||||||
attribute_key: key,
|
const queryOperator = fields.length - 1 === index1 && values.length - 1 === index2 ? null : 'OR';
|
||||||
filter_operator: 'contains',
|
payload.push({
|
||||||
values: values,
|
attribute_key: field,
|
||||||
query_operator: queryOperator,
|
filter_operator: 'contains',
|
||||||
|
values: [number],
|
||||||
|
query_operator: queryOperator,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.logger.verbose('Payload: ' + JSON.stringify(payload));
|
||||||
return payload;
|
return payload;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async createConversation(instance: InstanceDto, body: any) {
|
public async createConversation(instance: InstanceDto, body: any) {
|
||||||
this.logger.verbose('create conversation to instance: ' + instance.instanceName);
|
this.logger.verbose('create conversation to instance: ' + instance.instanceName);
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user