mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-16 04:02:54 -06:00
fix: get instance id in right place on handle label
This commit is contained in:
parent
013fa9dc08
commit
6e6711a5af
@ -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] });
|
const whatsappContact = await this.whatsappNumber({ numbers: [data.number] });
|
||||||
if (whatsappContact.length === 0) {
|
if (whatsappContact.length === 0) {
|
||||||
throw new NotFoundException('Number not found');
|
throw new NotFoundException('Number not found');
|
||||||
@ -3874,13 +3874,13 @@ export class BaileysStartupService extends ChannelStartupService {
|
|||||||
try {
|
try {
|
||||||
if (data.action === 'add') {
|
if (data.action === 'add') {
|
||||||
await this.client.addChatLabel(contact.jid, data.labelId);
|
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 };
|
return { numberJid: contact.jid, labelId: data.labelId, add: true };
|
||||||
}
|
}
|
||||||
if (data.action === 'remove') {
|
if (data.action === 'remove') {
|
||||||
await this.client.removeChatLabel(contact.jid, data.labelId);
|
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 };
|
return { numberJid: contact.jid, labelId: data.labelId, remove: true };
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user