mirror of
https://github.com/pierre42100/ComunicAPI
synced 2025-06-19 08:35:18 +00:00
Can delete groups.
This commit is contained in:
@ -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
|
||||
*
|
||||
|
Reference in New Issue
Block a user