mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2024-11-22 13:29:22 +00:00
Create the get_settings method
This commit is contained in:
parent
1dba026fe6
commit
7e28722574
@ -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
|
||||||
*
|
*
|
||||||
|
@ -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)},
|
||||||
]
|
]
|
Loading…
Reference in New Issue
Block a user