Class: Maestrano::Account::GroupsController

Inherits:
Rails::WebHookController
  • Object
show all
Defined in:
app/controllers/maestrano/account/groups_controller.rb

Instance Method Summary collapse

Instance Method Details

#destroyObject

DELETE /maestrano/account/groups/cld-1 DELETE /maestrano/account/groups/cld-1/tenant Delete an entire group



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/controllers/maestrano/account/groups_controller.rb', line 6

def destroy
  # id
  org_uid = params[:id]
  
  # Get entity
  organization = Maestrano::Connector::Rails::Organization.find_by_uid_and_tenant(org_uid, params[:tenant] || 'default')
  
  # Delete all relations
  organization.user_organization_rels.delete_all
  
  # Delete the organization
  organization.destroy
  
  # Respond
  render json: {success: true}
end