1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2024-12-28 14:38:52 +00:00

Can update group following status

This commit is contained in:
Pierre HUBERT 2020-06-29 09:03:32 +02:00
parent 7add678815
commit 330b18a365
2 changed files with 12 additions and 0 deletions

View File

@ -352,4 +352,14 @@ pub fn remove_membership(r: &mut HttpRequestHandler) -> RequestResult {
// TODO : delete group membership notifications
r.success("Your membership has been successfully deleted!")
}
/// Update following status over a group
pub fn set_following(r: &mut HttpRequestHandler) -> RequestResult {
let group_id = r.post_group_id_with_access("groupID", GroupAccessLevel::MEMBER_ACCESS)?;
let following = r.post_bool("follow")?;
groups_helper::set_following(&group_id, &r.user_id()?, following)?;
r.success("Following status updated.")
}

View File

@ -170,6 +170,8 @@ pub fn get_routes() -> Vec<Route> {
Route::post("/groups/remove_membership", Box::new(groups_controller::remove_membership)),
Route::post("/groups/set_following", Box::new(groups_controller::set_following)),
// Virtual directory controller
Route::post("/user/findbyfolder", Box::new(virtual_directory_controller::find_user)),