mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-16 04:02:54 -06:00
Merge branch 'release/1.4.6'
This commit is contained in:
commit
49376ddf6e
@ -104,16 +104,24 @@ export abstract class RouterBroker {
|
|||||||
const instance = request.params as unknown as InstanceDto;
|
const instance = request.params as unknown as InstanceDto;
|
||||||
const body = request.body;
|
const body = request.body;
|
||||||
|
|
||||||
if (!body?.groupJid) {
|
let groupJid = body?.groupJid;
|
||||||
if (request.query.groupJid) {
|
|
||||||
Object.assign(body, {
|
if (!groupJid) {
|
||||||
groupJid: request.query.groupJid,
|
if (request.query?.groupJid) {
|
||||||
});
|
groupJid = request.query.groupJid;
|
||||||
} else {
|
} 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"');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!groupJid.endsWith('@g.us')) {
|
||||||
|
groupJid = groupJid + '@g.us';
|
||||||
|
}
|
||||||
|
|
||||||
|
Object.assign(body, {
|
||||||
|
groupJid: groupJid
|
||||||
|
});
|
||||||
|
|
||||||
const ref = new ClassRef();
|
const ref = new ClassRef();
|
||||||
|
|
||||||
Object.assign(ref, body);
|
Object.assign(ref, body);
|
||||||
|
@ -55,19 +55,12 @@ export class InstanceController {
|
|||||||
try {
|
try {
|
||||||
this.logger.verbose('requested createInstance from ' + instanceName + ' instance');
|
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');
|
this.logger.verbose('checking duplicate token');
|
||||||
await this.authService.checkDuplicateToken(token);
|
await this.authService.checkDuplicateToken(token);
|
||||||
|
|
||||||
this.logger.verbose('creating instance');
|
this.logger.verbose('creating instance');
|
||||||
const instance = new WAStartupService(this.configService, this.eventEmitter, this.repository, this.cache);
|
const instance = new WAStartupService(this.configService, this.eventEmitter, 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.logger.verbose('instance: ' + instance.instanceName + ' created');
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user