Sha256: effaa401ef81780e17e3d23949cedc7f3ef7549714ef13272179d62666df5176

Contents?: true

Size: 1.24 KB

Versions: 86

Compression:

Stored size: 1.24 KB

Contents

require_dependency "zuora_connect/application_controller"

module ZuoraConnect
  class Api::V1::AppInstanceController < ApplicationController

    def create
      Apartment::Tenant.create(session['AppInstance'])
      respond_to do |format|
        format.json {render :json => "Created"}
      end
    end

    def drop
      instance_id = @appinstance.id
      if session["#{instance_id}::destroy"] && ZuoraConnect::AppInstance.where(:id => instance_id).size != 0
        if @appinstance.drop_instance
          ZuoraConnect::AppInstance.destroy(instance_id)
          msg = Apartment::Tenant.drop(instance_id)

          respond_to do |format|
            if msg.error_message.present?
              format.json {render json: {"message" => msg.error_message}, status: :bad_request }
            else
              format.json {render json: {}, status: :ok}
            end
          end
        else
          respond_to do |format|
            format.json {render json: {"message" => @appinstance.drop_message}, status: :bad_request}
          end
        end
      else
        respond_to do |format|
          format.json { render json: { "message" => "Unauthorized"}, status:  :unauthorized }
        end
      end
    end

    def status


    end

  end
end

Version data entries

86 entries across 86 versions & 1 rubygems

Version Path
zuora_connect-1.7.44 app/controllers/zuora_connect/api/v1/app_instance_controller.rb
zuora_connect-1.7.43 app/controllers/zuora_connect/api/v1/app_instance_controller.rb
zuora_connect-1.7.42 app/controllers/zuora_connect/api/v1/app_instance_controller.rb
zuora_connect-1.7.41 app/controllers/zuora_connect/api/v1/app_instance_controller.rb
zuora_connect-1.7.40 app/controllers/zuora_connect/api/v1/app_instance_controller.rb
zuora_connect-1.7.39 app/controllers/zuora_connect/api/v1/app_instance_controller.rb
zuora_connect-1.7.38 app/controllers/zuora_connect/api/v1/app_instance_controller.rb
zuora_connect-1.7.37 app/controllers/zuora_connect/api/v1/app_instance_controller.rb
zuora_connect-1.7.36 app/controllers/zuora_connect/api/v1/app_instance_controller.rb
zuora_connect-1.7.35 app/controllers/zuora_connect/api/v1/app_instance_controller.rb
zuora_connect-1.7.34 app/controllers/zuora_connect/api/v1/app_instance_controller.rb
zuora_connect-1.7.33 app/controllers/zuora_connect/api/v1/app_instance_controller.rb
zuora_connect-1.7.32 app/controllers/zuora_connect/api/v1/app_instance_controller.rb
zuora_connect-1.7.31 app/controllers/zuora_connect/api/v1/app_instance_controller.rb
zuora_connect-1.7.30 app/controllers/zuora_connect/api/v1/app_instance_controller.rb
zuora_connect-1.7.29 app/controllers/zuora_connect/api/v1/app_instance_controller.rb
zuora_connect-1.7.28 app/controllers/zuora_connect/api/v1/app_instance_controller.rb
zuora_connect-1.7.27 app/controllers/zuora_connect/api/v1/app_instance_controller.rb
zuora_connect-1.7.26 app/controllers/zuora_connect/api/v1/app_instance_controller.rb
zuora_connect-1.7.25 app/controllers/zuora_connect/api/v1/app_instance_controller.rb