1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2025-07-09 11:32:49 +00:00

Add /groups/get_my_list

This commit is contained in:
2019-12-13 17:49:58 +01:00
parent 8737607b53
commit ee6579efa0
3 changed files with 57 additions and 0 deletions

@ -0,0 +1,21 @@
import { RequestHandler } from "../entities/RequestHandler";
import { GroupsHelper } from "../helpers/GroupsHelper";
/**
* Groups API controller
*
* @author Pierre HUBERT
*/
export class GroupsController {
/**
* Get the list of groups of the user
*
* @param h Request handler
*/
public static async GetListUser(h: RequestHandler) {
h.send(await GroupsHelper.GetListUser(h.getUserId()));
}
}

@ -4,6 +4,7 @@ import { AccountController } from "./AccountController";
import { UserController } from "./UserController";
import { ConversationsController } from "./ConversationsController";
import { SearchController } from "./SearchController";
import { GroupsController } from "./GroupsController";
/**
* Controllers routes
@ -81,4 +82,8 @@ export const Routes : Route[] = [
// Search controller
{path: "/search/user", cb: (h) => SearchController.SearchUser(h)},
{path: "/user/search", cb: (h) => SearchController.SearchUser(h)}, // Legacy
// Groups controller
{path: "/groups/get_my_list", cb: (h) => GroupsController.GetListUser(h)},
]