Can delete groups.

This commit is contained in:
Pierre HUBERT
2018-08-31 09:56:46 +02:00
parent 9df1c93a24
commit 827fec68c7
5 changed files with 145 additions and 9 deletions

View File

@ -706,6 +706,25 @@ class GroupsController {
return array("success" => "Follow status has been successfully updated!");
}
/**
* Delete a group
*
* @url POST groups/delete
*/
public function delete(){
user_login_required();
//Get the group
$groupID = getPostGroupIdWithAccess("groupID", GroupInfo::ADMIN_ACCESS);
//Delete the group
if(!components()->groups->delete_group($groupID))
Rest_fatal_error(500, "Could not delete group!");
return array("success" => "The group has been successfully deleted!");
}
/**
* Parse a GroupInfo object into an array for the API
*