Merge pull request #538 from jaison-x/pr

fix(chatwoot): error: invalid operator. The allowed operators for identifier are [equal_to,not_equal_to]
This commit is contained in:
Davidson Gomes 2024-04-17 11:03:35 -03:00 committed by GitHub
commit 7d542cf115
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -461,7 +461,7 @@ export class ChatwootService {
const queryOperator = fieldsToSearch.length - 1 === index1 && numbers.length - 1 === index2 ? null : 'OR';
filterPayload.push({
attribute_key: field,
filter_operator: field == 'phone_number' ? 'equal_to' : 'contains',
filter_operator: ['phone_number', 'identifier'].includes(field) ? 'equal_to' : 'contains',
values: [number.replace('+', '')],
query_operator: queryOperator,
});