mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-16 12:12:55 -06:00
Update abstract.router.ts
This commit is contained in:
parent
fb6e58b3c4
commit
e7ed666037
@ -98,22 +98,24 @@ export abstract class RouterBroker {
|
||||
|
||||
public async groupValidate<T>(args: DataValidate<T>) {
|
||||
const { request, ClassRef, schema, execute } = args;
|
||||
const instance = request.params as unknown as InstanceDto;
|
||||
const body = request.body;
|
||||
|
||||
const groupJid = request.query as unknown as GroupJid;
|
||||
|
||||
if (!groupJid?.groupJid) {
|
||||
if (!body?.groupJid) {
|
||||
if (request.query.groupJid) {
|
||||
Object.assign(body, {
|
||||
groupJid: request.query.groupJid
|
||||
});
|
||||
} else {
|
||||
throw new BadRequestException(
|
||||
'The group id needs to be informed in the query',
|
||||
'ex: "groupJid=120362@g.us"',
|
||||
);
|
||||
}
|
||||
|
||||
const instance = request.params as unknown as InstanceDto;
|
||||
const body = request.body;
|
||||
}
|
||||
|
||||
const ref = new ClassRef();
|
||||
|
||||
Object.assign(body, groupJid);
|
||||
Object.assign(ref, body);
|
||||
|
||||
const v = validate(ref, schema);
|
||||
|
Loading…
Reference in New Issue
Block a user