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:
src
21
src/controllers/GroupsController.ts
Normal file
21
src/controllers/GroupsController.ts
Normal file
@ -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)},
|
||||
]
|
Reference in New Issue
Block a user