Skip to content

Commit 9401216

Browse files
committed
fix(whatsapp): lint
1 parent b8d6c87 commit 9401216

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

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

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,7 @@ export class BaileysStartupService extends ChannelStartupService {
997997
contactsMapLidJid.set(contact.id, { jid });
998998
}
999999

1000-
let chatsRaw: { remoteJid: string; remoteLid: string; instanceId: string; name?: string }[] = [];
1000+
const 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,
@@ -1028,19 +1028,18 @@ export class BaileysStartupService extends ChannelStartupService {
10281028

10291029
if (!remoteJid) {
10301030
remoteJid = chat.id;
1031-
}
1031+
}
10321032

10331033
chatsRaw.push({ remoteJid, remoteLid, instanceId: this.instanceId, name: chat.name });
10341034
}
10351035

10361036
this.sendDataWebhook(Events.CHATS_SET, chatsRaw);
10371037

10381038
if (this.configService.get<Database>('DATABASE').SAVE_DATA.HISTORIC) {
1039-
10401039
const chatsToCreateMany = JSON.parse(JSON.stringify(chatsRaw)).map((chat) => {
10411040
delete chat.remoteLid;
10421041
return chat;
1043-
})
1042+
});
10441043

10451044
await this.prismaRepository.chat.createMany({ data: chatsToCreateMany, skipDuplicates: true });
10461045
}
@@ -1527,13 +1526,12 @@ export class BaileysStartupService extends ChannelStartupService {
15271526
sendTelemetry(`received.message.${messageRaw.messageType ?? 'unknown'}`);
15281527

15291528
if (messageRaw.key.remoteJid?.includes('@lid') && messageRaw.key.remoteJidAlt) {
1530-
1531-
const lid = messageRaw.key.remoteJid
1529+
const lid = messageRaw.key.remoteJid;
15321530

15331531
messageRaw.key.remoteJid = messageRaw.key.remoteJidAlt;
1534-
messageRaw.key.remoteJidAlt = lid
1532+
messageRaw.key.remoteJidAlt = lid;
15351533

1536-
messageRaw.key.addressingMode = 'pn'
1534+
messageRaw.key.addressingMode = 'pn';
15371535
}
15381536
console.log(messageRaw);
15391537

0 commit comments

Comments
 (0)