mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-22 05:12:20 -06:00
fix: Validate if source id already exists in chatwoot
Check if message is already saved before sending it
This commit is contained in:
@@ -890,6 +890,13 @@ export class ChatwootService {
|
||||
sourceId?: string,
|
||||
quotedMsg?: MessageModel,
|
||||
) {
|
||||
if (sourceId) {
|
||||
const messageAlreadySaved = await chatwootImport.getExistingSourceIds([sourceId]);
|
||||
if (messageAlreadySaved.size > 0) {
|
||||
this.logger.warn('Message already saved on chatwoot');
|
||||
return null;
|
||||
}
|
||||
}
|
||||
const data = new FormData();
|
||||
|
||||
if (content) {
|
||||
|
||||
Reference in New Issue
Block a user