Skip to content

Commit 6e6711a

Browse files
committed
fix: get instance id in right place on handle label
1 parent 013fa9d commit 6e6711a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3861,7 +3861,7 @@ export class BaileysStartupService extends ChannelStartupService {
38613861
}));
38623862
}
38633863

3864-
public async handleLabel(data: HandleLabelDto, instanceId: string) {
3864+
public async handleLabel(data: HandleLabelDto) {
38653865
const whatsappContact = await this.whatsappNumber({ numbers: [data.number] });
38663866
if (whatsappContact.length === 0) {
38673867
throw new NotFoundException('Number not found');
@@ -3874,13 +3874,13 @@ export class BaileysStartupService extends ChannelStartupService {
38743874
try {
38753875
if (data.action === 'add') {
38763876
await this.client.addChatLabel(contact.jid, data.labelId);
3877-
await this.addLabel(data.labelId, instanceId, contact.jid);
3877+
await this.addLabel(data.labelId, this.instanceId, contact.jid);
38783878

38793879
return { numberJid: contact.jid, labelId: data.labelId, add: true };
38803880
}
38813881
if (data.action === 'remove') {
38823882
await this.client.removeChatLabel(contact.jid, data.labelId);
3883-
await this.removeLabel(data.labelId, instanceId, contact.jid);
3883+
await this.removeLabel(data.labelId, this.instanceId, contact.jid);
38843884

38853885
return { numberJid: contact.jid, labelId: data.labelId, remove: true };
38863886
}

0 commit comments

Comments
 (0)