Skip to content

Commit 3459d61

Browse files
committed
fix: Corrige o PR1481
1 parent 8b15c11 commit 3459d61

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/api/integrations/chatbot/chatwoot/utils/chatwoot-import-helper.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,10 @@ class ChatwootImport {
180180
const formattedSourceIds = sourceIds.map((sourceId) => `WAID:${sourceId.replace('WAID:', '')}`); // Make sure the sourceId is always formatted as WAID:1234567890
181181
let query: string;
182182
if (conversationId) {
183-
query = 'SELECT source_id FROM messages WHERE source_id = ANY($1)';
184-
}
183+
query = 'SELECT source_id FROM messages WHERE source_id = ANY($1) AND conversation_id = $2';
185184

186185
if (!conversationId) {
187-
query = 'SELECT source_id FROM messages WHERE source_id = ANY($1) AND conversation_id = $2';
186+
query = 'SELECT source_id FROM messages WHERE source_id = ANY($1)';
188187
}
189188

190189
const pgClient = postgresClient.getChatwootConnection();

0 commit comments

Comments
 (0)