File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
src/api/integrations/channel/whatsapp Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -997,7 +997,7 @@ export class BaileysStartupService extends ChannelStartupService {
997997 contactsMapLidJid . set ( contact . id , { jid } ) ;
998998 }
999999
1000- const chatsRaw : { remoteJid : string ; remoteLid : string ; instanceId : string ; name ?: string } [ ] = [ ] ;
1000+ let chatsRaw : { remoteJid : string ; remoteLid : string ; instanceId : string ; name ?: string } [ ] = [ ] ;
10011001 const chatsRepository = new Set (
10021002 ( await this . prismaRepository . chat . findMany ( { where : { instanceId : this . instanceId } } ) ) . map (
10031003 ( chat ) => chat . remoteJid ,
@@ -1032,6 +1032,12 @@ export class BaileysStartupService extends ChannelStartupService {
10321032 this . sendDataWebhook ( Events . CHATS_SET , chatsRaw ) ;
10331033
10341034 if ( this . configService . get < Database > ( 'DATABASE' ) . SAVE_DATA . HISTORIC ) {
1035+ chatsRaw = chatsRaw . map ( ( chat ) => {
1036+ delete chat . remoteLid ;
1037+
1038+ return chat ;
1039+ } ) ;
1040+
10351041 await this . prismaRepository . chat . createMany ( { data : chatsRaw , skipDuplicates : true } ) ;
10361042 }
10371043
You can’t perform that action at this time.
0 commit comments