fix: Added replace special caracters and espaces in instanceName

This commit is contained in:
Davidson Gomes 2023-07-18 12:58:53 -03:00
parent a9fafec79d
commit b3e213c133

View File

@ -64,7 +64,10 @@ export class InstanceController {
this.repository,
this.cache,
);
instance.instanceName = instanceName;
instance.instanceName = instanceName
.toLowerCase()
.replace(/[^a-z0-9]/g, '')
.replace(' ', '');
this.logger.verbose('instance: ' + instance.instanceName + ' created');
this.waMonitor.waInstances[instance.instanceName] = instance;
@ -191,7 +194,10 @@ export class InstanceController {
this.repository,
this.cache,
);
instance.instanceName = instanceName;
instance.instanceName = instanceName
.toLowerCase()
.replace(/[^a-z0-9]/g, '')
.replace(' ', '');
this.logger.verbose('instance: ' + instance.instanceName + ' created');