mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-23 04:22:02 -06:00
Fix for brazil 9 digit
This commit is contained in:
parent
b995cdfc32
commit
54603002a6
@ -447,29 +447,28 @@ export class ChatwootService {
|
||||
}
|
||||
|
||||
private getSearchableFields() {
|
||||
return ['identifier', 'phone_number', 'name', 'email'];
|
||||
return ['phone_number'];
|
||||
}
|
||||
|
||||
private getFilterPayload(query: string) {
|
||||
const payload = [];
|
||||
const values = this.getNumbers(query);
|
||||
const filterPayload = [];
|
||||
|
||||
const fields = this.getSearchableFields();
|
||||
const numbers = this.getNumbers(query);
|
||||
const fieldsToSearch = this.getSearchableFields();
|
||||
|
||||
fields.forEach((field, index1) => {
|
||||
values.forEach((number, index2) => {
|
||||
const queryOperator = fields.length - 1 === index1 && values.length - 1 === index2 ? null : 'OR';
|
||||
payload.push({
|
||||
fieldsToSearch.forEach((field, index1) => {
|
||||
numbers.forEach((number, index2) => {
|
||||
const queryOperator = fieldsToSearch.length - 1 === index1 && numbers.length - 1 === index2 ? null : 'OR';
|
||||
filterPayload.push({
|
||||
attribute_key: field,
|
||||
filter_operator: 'contains',
|
||||
values: [number],
|
||||
filter_operator: 'equal_to',
|
||||
values: [number.replace('+', '')],
|
||||
query_operator: queryOperator,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
this.logger.verbose('Payload: ' + JSON.stringify(payload));
|
||||
return payload;
|
||||
return filterPayload;
|
||||
}
|
||||
public async createConversation(instance: InstanceDto, body: any) {
|
||||
this.logger.verbose('create conversation to instance: ' + instance.instanceName);
|
||||
|
Loading…
Reference in New Issue
Block a user