Skip to content

Commit

Permalink
fix: get instance id in right place on handle label
Browse files Browse the repository at this point in the history
  • Loading branch information
ImPedro29 committed Nov 19, 2024
1 parent 013fa9d commit 6e6711a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3861,7 +3861,7 @@ export class BaileysStartupService extends ChannelStartupService {
}));
}

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

return { numberJid: contact.jid, labelId: data.labelId, add: true };
}
if (data.action === 'remove') {
await this.client.removeChatLabel(contact.jid, data.labelId);
await this.removeLabel(data.labelId, instanceId, contact.jid);
await this.removeLabel(data.labelId, this.instanceId, contact.jid);

return { numberJid: contact.jid, labelId: data.labelId, remove: true };
}
Expand Down

0 comments on commit 6e6711a

Please sign in to comment.