|
@@ -117,8 +117,18 @@ class WhasAppClient {
|
|
|
});
|
|
|
this.client.on('disconnected', async (reason) => {
|
|
|
console.log(`be:${this.clientId}:Client was logged out`, reason);
|
|
|
- await this.client.destroy();
|
|
|
map.delete(this.clientId);
|
|
|
+ // kirim ke abi untuk update status
|
|
|
+ axios.post('https://nexilis.io/dashboardv2/logics/update_whatsapp_login', {
|
|
|
+ be: this.clientId,
|
|
|
+ status: 0
|
|
|
+ })
|
|
|
+ .then(function (response) {
|
|
|
+ console.log(`response: ${response.data}`);
|
|
|
+ })
|
|
|
+ .catch(function (error) {
|
|
|
+ console.log(error);
|
|
|
+ });
|
|
|
});
|
|
|
}
|
|
|
}
|