Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Loading