Skip to content

Commit 0cdc67e

Browse files
committed
fix: eslint
1 parent ddaf32b commit 0cdc67e

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,17 +177,16 @@ class ChatwootImport {
177177
return existingSourceIdsSet;
178178
}
179179

180+
// Ensure all sourceIds are consistently prefixed with 'WAID:' as required by downstream systems and database queries.
180181
const formattedSourceIds = sourceIds.map((sourceId) => `WAID:${sourceId.replace('WAID:', '')}`);
181182
const pgClient = postgresClient.getChatwootConnection();
182-
183-
const params = conversationId
184-
? [formattedSourceIds, conversationId]
185-
: [formattedSourceIds];
186-
183+
184+
const params = conversationId ? [formattedSourceIds, conversationId] : [formattedSourceIds];
185+
187186
const query = conversationId
188187
? 'SELECT source_id FROM messages WHERE source_id = ANY($1) AND conversation_id = $2'
189188
: 'SELECT source_id FROM messages WHERE source_id = ANY($1)';
190-
189+
191190
const result = await pgClient.query(query, params);
192191
for (const row of result.rows) {
193192
existingSourceIdsSet.add(row.source_id);

0 commit comments

Comments
 (0)