Merge branch 'develop' into groupJid-query-or-body

This commit is contained in:
Davidson Gomes 2023-07-26 18:40:54 -03:00 committed by GitHub
commit 86fc9fbffa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 13 deletions

View File

@ -1,4 +1,4 @@
# 1.4.6 (homolog)
# 1.4.6 (2023-07-26 17:54)
### Fixed

View File

@ -110,10 +110,7 @@ export abstract class RouterBroker {
if (request.query?.groupJid) {
groupJid = request.query.groupJid;
} else {
throw new BadRequestException(
'The group id needs to be informed in the query',
'ex: "groupJid=120362@g.us"',
);
throw new BadRequestException('The group id needs to be informed in the query', 'ex: "groupJid=120362@g.us"');
}
}

View File

@ -55,19 +55,12 @@ export class InstanceController {
try {
this.logger.verbose('requested createInstance from ' + instanceName + ' instance');
if (instanceName !== instanceName.toLowerCase().replace(/[^a-z0-9]/g, '')) {
throw new BadRequestException('The instance name must be lowercase and without special characters');
}
this.logger.verbose('checking duplicate token');
await this.authService.checkDuplicateToken(token);
this.logger.verbose('creating instance');
const instance = new WAStartupService(this.configService, this.eventEmitter, this.repository, this.cache);
instance.instanceName = instanceName
.toLowerCase()
.replace(/[^a-z0-9]/g, '')
.replace(' ', '');
instance.instanceName = instanceName;
this.logger.verbose('instance: ' + instance.instanceName + ' created');