Skip to content

Commit 4137984

Browse files
committed
Refactor message deletion in BaileysStartupService
1 parent 96821f5 commit 4137984

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
@@ -3572,6 +3572,18 @@ export class BaileysStartupService extends ChannelStartupService {
35723572
status: 'DELETED',
35733573
},
35743574
});
3575+
const messageUpdate: any = {
3576+
messageId: message.id,
3577+
keyId: messageId,
3578+
remoteJid: response.key.remoteJid,
3579+
fromMe: response.key.fromMe,
3580+
participant: response.key?.remoteJid,
3581+
status: 'DELETED',
3582+
instanceId: this.instanceId,
3583+
};
3584+
await this.prismaRepository.messageUpdate.create({
3585+
data: messageUpdate,
3586+
});
35753587
} else {
35763588
await this.prismaRepository.message.deleteMany({
35773589
where: {

0 commit comments

Comments
 (0)