mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2024-11-22 21:39:21 +00:00
Can get a single user membership
This commit is contained in:
parent
2d796d11bd
commit
7ef9f8dfc1
@ -312,3 +312,13 @@ pub fn respond_request(r: &mut HttpRequestHandler) -> RequestResult {
|
|||||||
|
|
||||||
r.success("The response to the request has been successfully saved!")
|
r.success("The response to the request has been successfully saved!")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Get information about a single user membership over a group
|
||||||
|
pub fn get_membership(r: &mut HttpRequestHandler) -> RequestResult {
|
||||||
|
let group_id = r.post_group_id_with_access("groupID", GroupAccessLevel::MODERATOR_ACCESS)?;
|
||||||
|
let user_id = r.post_user_id("userID")?;
|
||||||
|
|
||||||
|
let membership = groups_helper::get_membership(&group_id, Some(user_id))?;
|
||||||
|
|
||||||
|
r.set_response(GroupMemberAPI::new(&membership))
|
||||||
|
}
|
@ -164,6 +164,8 @@ pub fn get_routes() -> Vec<Route> {
|
|||||||
|
|
||||||
Route::post("/groups/respond_request", Box::new(groups_controller::respond_request)),
|
Route::post("/groups/respond_request", Box::new(groups_controller::respond_request)),
|
||||||
|
|
||||||
|
Route::post("/groups/get_membership", Box::new(groups_controller::get_membership)),
|
||||||
|
|
||||||
|
|
||||||
// Virtual directory controller
|
// Virtual directory controller
|
||||||
Route::post("/user/findbyfolder", Box::new(virtual_directory_controller::find_user)),
|
Route::post("/user/findbyfolder", Box::new(virtual_directory_controller::find_user)),
|
||||||
|
Loading…
Reference in New Issue
Block a user