Skip to content

Commit 23970e5

Browse files
matheusmartinsInspermatheusmartinsInsper
authored andcommitted
Refactor message deletion in BaileysStartupService
1 parent 5c285be commit 23970e5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3004,6 +3004,18 @@ export class BaileysStartupService extends ChannelStartupService {
30043004
status: 'DELETED',
30053005
},
30063006
});
3007+
const messageUpdate: any = {
3008+
messageId: message.id,
3009+
keyId: messageId,
3010+
remoteJid: response.key.remoteJid,
3011+
fromMe: response.key.fromMe,
3012+
participant: response.key?.remoteJid,
3013+
status: 'DELETED',
3014+
instanceId: this.instanceId,
3015+
};
3016+
await this.prismaRepository.messageUpdate.create({
3017+
data: messageUpdate,
3018+
});
30073019
} else {
30083020
await this.prismaRepository.message.deleteMany({
30093021
where: {

0 commit comments

Comments
 (0)