Skip to content

Commit 9bdbfc6

Browse files
committed
wip
1 parent 6840239 commit 9bdbfc6

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

src/whatsapp/abstract/abstract.router.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,11 @@ export abstract class RouterBroker {
104104
const instance = request.params as unknown as InstanceDto;
105105
const body = request.body;
106106

107-
if (!body?.groupJid) {
108-
if (request.query.groupJid) {
109-
Object.assign(body, {
110-
groupJid: request.query.groupJid
111-
});
107+
let groupJid = body?.groupJid;
108+
109+
if (!groupJid) {
110+
if (request.query?.groupJid) {
111+
groupJid = request.query.groupJid;
112112
} else {
113113
throw new BadRequestException(
114114
'The group id needs to be informed in the query',
@@ -117,6 +117,14 @@ export abstract class RouterBroker {
117117
}
118118
}
119119

120+
if (!groupJid.endsWith('@g.us')) {
121+
groupJid = groupJid + '@g.us';
122+
}
123+
124+
Object.assign(body, {
125+
groupJid: groupJid
126+
});
127+
120128
const ref = new ClassRef();
121129

122130
Object.assign(ref, body);

0 commit comments

Comments
 (0)