This commit is contained in:
Alan Mosko 2023-07-26 18:28:18 -03:00
parent 68402393b5
commit 9bdbfc6f4f

View File

@ -104,11 +104,11 @@ 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( throw new BadRequestException(
'The group id needs to be informed in the query', 'The group id needs to be informed in the query',
@ -117,6 +117,14 @@ export abstract class RouterBroker {
} }
} }
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);