File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed
Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -104,16 +104,24 @@ 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 ( 'The group id needs to be informed in the query' , 'ex: "groupJid=120362@g.us"' ) ;
114114 }
115115 }
116-
116+
117+ if ( ! groupJid . endsWith ( '@g.us' ) ) {
118+ groupJid = groupJid + '@g.us' ;
119+ }
120+
121+ Object . assign ( body , {
122+ groupJid : groupJid
123+ } ) ;
124+
117125 const ref = new ClassRef ( ) ;
118126
119127 Object . assign ( ref , body ) ;
You can’t perform that action at this time.
0 commit comments