Skip to content

Commit 631dd01

Browse files
committed
feat: added option to generate qrcode as soon as the instance is created
1 parent fdc72bc commit 631dd01

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

src/whatsapp/services/monitor.service.ts

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,26 @@ export class WAMonitoringService {
9595
});
9696
}
9797
} else {
98-
instances.push({
99-
instance: {
100-
instanceName: key,
101-
status: value.connectionStatus.state,
102-
},
103-
});
98+
let apikey: string;
99+
if (this.configService.get<Auth>('AUTHENTICATION').EXPOSE_IN_FETCH_INSTANCES) {
100+
const tokenStore = await this.repository.auth.find(key);
101+
apikey = tokenStore.apikey || 'Apikey not found';
102+
103+
instances.push({
104+
instance: {
105+
instanceName: key,
106+
status: value.connectionStatus.state,
107+
apikey,
108+
},
109+
});
110+
} else {
111+
instances.push({
112+
instance: {
113+
instanceName: key,
114+
status: value.connectionStatus.state,
115+
},
116+
});
117+
}
104118
}
105119
}
106120
}

0 commit comments

Comments
 (0)