Merge pull request #1490 from KokeroO/develop

fix: Corrige o PR1481
This commit is contained in:
Davidson Gomes 2025-05-22 17:08:43 -03:00 committed by GitHub
commit 0239638232
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -180,11 +180,10 @@ class ChatwootImport {
const formattedSourceIds = sourceIds.map((sourceId) => `WAID:${sourceId.replace('WAID:', '')}`); // Make sure the sourceId is always formatted as WAID:1234567890
let query: string;
if (conversationId) {
query = 'SELECT source_id FROM messages WHERE source_id = ANY($1)';
}
query = 'SELECT source_id FROM messages WHERE source_id = ANY($1) AND conversation_id = $2';
if (!conversationId) {
query = 'SELECT source_id FROM messages WHERE source_id = ANY($1) AND conversation_id = $2';
query = 'SELECT source_id FROM messages WHERE source_id = ANY($1)';
}
const pgClient = postgresClient.getChatwootConnection();