feat: Route to fetch all groups that the connection is part of

This commit is contained in:
Davidson Gomes
2023-06-11 11:00:40 -03:00
parent 75b8bcb853
commit ea8d6bf6c8
5 changed files with 54 additions and 0 deletions

View File

@@ -55,6 +55,16 @@ export class GroupRouter extends RouterBroker {
res.status(HttpStatus.OK).json(response);
})
.get(this.routerPath('fetchAllGroups'), ...guards, async (req, res) => {
const response = await this.groupNoValidate<GroupJid>({
request: req,
schema: {},
ClassRef: GroupJid,
execute: (instance) => groupController.fetchAllGroups(instance),
});
res.status(HttpStatus.OK).json(response);
})
.get(this.routerPath('participants'), ...guards, async (req, res) => {
const response = await this.groupValidate<GroupJid>({
request: req,