mirror of
				https://gitlab.com/comunic/comunicapiv2
				synced 2025-11-04 11:34:04 +00:00 
			
		
		
		
	Implement groups visibility system
This commit is contained in:
		@@ -1,5 +1,6 @@
 | 
			
		||||
import { RequestHandler } from "../entities/RequestHandler";
 | 
			
		||||
import { GroupsHelper } from "../helpers/GroupsHelper";
 | 
			
		||||
import { GroupsAccessLevel } from "../entities/Group";
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Groups API controller
 | 
			
		||||
@@ -18,4 +19,13 @@ export class GroupsController {
 | 
			
		||||
		h.send(await GroupsHelper.GetListUser(h.getUserId()));
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 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!");
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
@@ -86,4 +86,6 @@ export const Routes : Route[] = [
 | 
			
		||||
 | 
			
		||||
	// Groups controller
 | 
			
		||||
	{path: "/groups/get_my_list", cb: (h) => GroupsController.GetListUser(h)},
 | 
			
		||||
 | 
			
		||||
	{path: "/groups/get_info", cb: (h) => GroupsController.GetInfoSingle(h)},
 | 
			
		||||
]
 | 
			
		||||
		Reference in New Issue
	
	Block a user