feat: Improved fetch instances endpoint and prepare changelog to version 1.1.0 in homolog

This commit is contained in:
Davidson Gomes
2023-06-10 18:56:11 -03:00
parent f067cb99c8
commit ae1c5908ae
4 changed files with 36 additions and 17 deletions

View File

@@ -60,16 +60,25 @@ export class WAMonitoringService {
const instances: any[] = [];
for await (const [key, value] of Object.entries(this.waInstances)) {
if (value && value.connectionStatus.state === 'open') {
instances.push({
instance: {
instanceName: key,
owner: value.wuid,
profileName: (await value.getProfileName()) || 'not loaded',
profilePictureUrl: value.profilePictureUrl,
status: (await value.getProfileStatus()) || '',
},
});
if (value) {
if (value.connectionStatus.state === 'open') {
instances.push({
instance: {
instanceName: key,
owner: value.wuid,
profileName: (await value.getProfileName()) || 'not loaded',
profilePictureUrl: value.profilePictureUrl,
status: (await value.getProfileStatus()) || '',
},
});
} else {
instances.push({
instance: {
instanceName: key,
status: value.connectionStatus.state,
},
});
}
}
}