mirror of
				https://gitlab.com/comunic/comunicapiv3
				synced 2025-11-03 17:14:03 +00:00 
			
		
		
		
	Can delete group
This commit is contained in:
		@@ -199,7 +199,7 @@ pub fn delete_account(r: &mut HttpRequestHandler) -> RequestResult {
 | 
			
		||||
        r.forbidden("You shall not delete MY account (whoever you are, please note that hacking is bad !!!)".to_string())?;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    account_helper::delete(r.user_id_ref()?);
 | 
			
		||||
    account_helper::delete(r.user_id_ref()?)?;
 | 
			
		||||
 | 
			
		||||
    r.success("Account deleted.")
 | 
			
		||||
}
 | 
			
		||||
@@ -11,7 +11,6 @@ use crate::api_data::res_change_group_logo::ResChangeGroupLogo;
 | 
			
		||||
use crate::api_data::res_create_group::GroupCreationResult;
 | 
			
		||||
use crate::constants::{DEFAULT_GROUP_LOGO, PATH_GROUPS_LOGOS};
 | 
			
		||||
use crate::controllers::routes::RequestResult;
 | 
			
		||||
use crate::data::error::ExecError;
 | 
			
		||||
use crate::data::group::{Group, GroupAccessLevel, GroupPostsCreationLevel, GroupRegistrationLevel, GroupVisibilityLevel};
 | 
			
		||||
use crate::data::group_id::GroupID;
 | 
			
		||||
use crate::data::group_member::{GroupMember, GroupMembershipLevel};
 | 
			
		||||
@@ -367,6 +366,10 @@ pub fn set_following(r: &mut HttpRequestHandler) -> RequestResult {
 | 
			
		||||
 | 
			
		||||
/// Delete a group
 | 
			
		||||
pub fn delete_group(r: &mut HttpRequestHandler) -> RequestResult {
 | 
			
		||||
    // TODO : implement groups deletion
 | 
			
		||||
    r.internal_error(ExecError::boxed_new("Method not implemented yet"))
 | 
			
		||||
    let group_id = r.post_group_id_with_access("groupID", GroupAccessLevel::ADMIN_ACCESS)?;
 | 
			
		||||
    r.need_user_password("password")?;
 | 
			
		||||
 | 
			
		||||
    groups_helper::delete(&group_id)?;
 | 
			
		||||
 | 
			
		||||
    r.success("Group deleted.")
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user