mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2024-12-27 22:18:51 +00:00
Can update group following status
This commit is contained in:
parent
7add678815
commit
330b18a365
@ -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.")
|
||||
}
|
@ -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)),
|
||||
|
Loading…
Reference in New Issue
Block a user