File tree Expand file tree Collapse file tree 1 file changed +7
-13
lines changed
Expand file tree Collapse file tree 1 file changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -101,24 +101,18 @@ 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+
104110 const instance = request . params as unknown as InstanceDto ;
105111 const body = request . body ;
106112
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 (
114- 'The group id needs to be informed in the query' ,
115- 'ex: "groupJid=120362@g.us"' ,
116- ) ;
117- }
118- }
119-
120113 const ref = new ClassRef ( ) ;
121114
115+ Object . assign ( body , groupJid ) ;
122116 Object . assign ( ref , body ) ;
123117
124118 const v = validate ( ref , schema ) ;
You can’t perform that action at this time.
0 commit comments