1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2024-11-26 07:19:23 +00:00

Create the get_settings method

This commit is contained in:
Pierre HUBERT 2019-12-25 15:43:43 +01:00
parent 1dba026fe6
commit 7e28722574
2 changed files with 17 additions and 0 deletions

View File

@ -129,6 +129,21 @@ export class GroupsController {
h.send(await this.GroupInfoToAPI(group, h, true)); h.send(await this.GroupInfoToAPI(group, h, true));
} }
/**
* Get group settings
*
* @param h Request handler
*/
public static async GetSettings(h: RequestHandler) {
const groupID = await h.postGroupIDWithAccess("id", GroupsAccessLevel.ADMIN_ACCESS);
// For now, this method is the same as the get advanced info methods,
// but this might change in the future...
const group = await GroupsHelper.GetInfo(groupID);
h.send(await this.GroupInfoToAPI(group, h, true));
}
/** /**
* Turn a GroupInfo object into a valid API object * Turn a GroupInfo object into a valid API object
* *

View File

@ -94,4 +94,6 @@ export const Routes : Route[] = [
{path: "/groups/get_multiple_info", cb: (h) => GroupsController.GetInfoMultiple(h)}, {path: "/groups/get_multiple_info", cb: (h) => GroupsController.GetInfoMultiple(h)},
{path: "/groups/get_advanced_info", cb: (h) => GroupsController.GetAdvancedInfo(h), needLogin: false}, {path: "/groups/get_advanced_info", cb: (h) => GroupsController.GetAdvancedInfo(h), needLogin: false},
{path: "/groups/get_settings", cb: (h) => GroupsController.GetSettings(h)},
] ]