2019-12-13 16:49:58 +00:00
|
|
|
import { RequestHandler } from "../entities/RequestHandler";
|
|
|
|
import { GroupsHelper } from "../helpers/GroupsHelper";
|
2019-12-13 17:30:08 +00:00
|
|
|
import { GroupsAccessLevel } from "../entities/Group";
|
2019-12-13 16:49:58 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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()));
|
|
|
|
}
|
|
|
|
|
2019-12-13 17:30:08 +00:00
|
|
|
/**
|
|
|
|
* Get information about a single group
|
|
|
|
*
|
|
|
|
* @param h Request handler
|
|
|
|
*/
|
|
|
|
public static async GetInfoSingle(h: RequestHandler) {
|
|
|
|
const groupID = await h.postGroupIDWithAccess("id", GroupsAccessLevel.LIMITED_ACCESS);
|
|
|
|
h.send("Good progress!");
|
|
|
|
}
|
2019-12-13 16:49:58 +00:00
|
|
|
}
|