fix: Corrige o PR1481

This commit is contained in:
Willian Coqueiro 2025-05-22 20:03:32 +00:00
parent 8b15c11817
commit 3459d61eff

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();