Sha256: 49f4dba918cc266b473b8f1ad108ae3f20ac37f698eaa3681fb2d0b17a675b7c

Contents?: true

Size: 640 Bytes

Versions: 3

Compression:

Stored size: 640 Bytes

Contents

class Maestrano::Account::GroupsController < Maestrano::Rails::WebHookController
  # DELETE /maestrano/account/groups/cld-1/tenant
  # Delete an entire group
  def destroy
    # id
    org_uid = params[:id]

    # Get entity
    organization = Maestrano::Connector::Rails::Organization.find_by_uid_and_tenant(org_uid, params[:tenant] || 'default')

    Maestrano::Connector::Rails::ConnectorLogger.log('info', organization, 'delete organization')

    # Delete all relations
    organization.user_organization_rels.delete_all

    # Delete the organization
    organization.destroy

    # Respond
    render json: {success: true}
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
maestrano-connector-rails-2.0.0.pre.RC11 app/controllers/maestrano/account/groups_controller.rb
maestrano-connector-rails-2.0.0.pre.RC10 app/controllers/maestrano/account/groups_controller.rb
maestrano-connector-rails-2.0.0.pre.RC9 app/controllers/maestrano/account/groups_controller.rb