mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2024-12-29 06:58:50 +00:00
Can update group following status
This commit is contained in:
parent
7add678815
commit
330b18a365
@ -353,3 +353,13 @@ pub fn remove_membership(r: &mut HttpRequestHandler) -> RequestResult {
|
|||||||
|
|
||||||
r.success("Your membership has been successfully deleted!")
|
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.")
|
||||||
|
}
|
@ -170,6 +170,8 @@ pub fn get_routes() -> Vec<Route> {
|
|||||||
|
|
||||||
Route::post("/groups/remove_membership", Box::new(groups_controller::remove_membership)),
|
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
|
// 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