Skip to content

Commit 127cd3e

Browse files
committed
Merge branch 'release/1.4.6'
2 parents d3c7677 + 457dbe5 commit 127cd3e

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/whatsapp/abstract/abstract.router.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,18 +101,21 @@ export abstract class RouterBroker {
101101
public async groupValidate<T>(args: DataValidate<T>) {
102102
const { request, ClassRef, schema, execute } = args;
103103

104-
const groupJid = request.query as unknown as GroupJid;
105-
106-
if (!groupJid?.groupJid) {
107-
throw new BadRequestException('The group id needs to be informed in the query', 'ex: "groupJid=120362@g.us"');
108-
}
109-
110104
const instance = request.params as unknown as InstanceDto;
111105
const body = request.body;
112106

107+
if (!body?.groupJid) {
108+
if (request.query.groupJid) {
109+
Object.assign(body, {
110+
groupJid: request.query.groupJid,
111+
});
112+
} else {
113+
throw new BadRequestException('The group id needs to be informed in the query', 'ex: "groupJid=120362@g.us"');
114+
}
115+
}
116+
113117
const ref = new ClassRef();
114118

115-
Object.assign(body, groupJid);
116119
Object.assign(ref, body);
117120

118121
const v = validate(ref, schema);

0 commit comments

Comments
 (0)