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.795b app/controllers/zuora_connect/api/v1/app_instance_controller.rb
zuora_connect-1.7.794 app/controllers/zuora_connect/api/v1/app_instance_controller.rb
zuora_connect-1.7.793 app/controllers/zuora_connect/api/v1/app_instance_controller.rb
zuora_connect-1.7.791 app/controllers/zuora_connect/api/v1/app_instance_controller.rb
zuora_connect-1.7.79 app/controllers/zuora_connect/api/v1/app_instance_controller.rb
zuora_connect-1.7.78 app/controllers/zuora_connect/api/v1/app_instance_controller.rb
zuora_connect-1.7.76 app/controllers/zuora_connect/api/v1/app_instance_controller.rb
zuora_connect-1.7.75 app/controllers/zuora_connect/api/v1/app_instance_controller.rb
zuora_connect-1.7.74 app/controllers/zuora_connect/api/v1/app_instance_controller.rb
zuora_connect-1.7.73 app/controllers/zuora_connect/api/v1/app_instance_controller.rb
zuora_connect-1.7.72 app/controllers/zuora_connect/api/v1/app_instance_controller.rb
zuora_connect-1.7.711 app/controllers/zuora_connect/api/v1/app_instance_controller.rb
zuora_connect-1.7.710 app/controllers/zuora_connect/api/v1/app_instance_controller.rb
zuora_connect-1.7.71 app/controllers/zuora_connect/api/v1/app_instance_controller.rb
zuora_connect-1.7.70 app/controllers/zuora_connect/api/v1/app_instance_controller.rb
zuora_connect-1.7.69 app/controllers/zuora_connect/api/v1/app_instance_controller.rb
zuora_connect-1.7.68 app/controllers/zuora_connect/api/v1/app_instance_controller.rb
zuora_connect-1.7.67 app/controllers/zuora_connect/api/v1/app_instance_controller.rb
zuora_connect-1.7.66 app/controllers/zuora_connect/api/v1/app_instance_controller.rb
zuora_connect-1.7.65 app/controllers/zuora_connect/api/v1/app_instance_controller.rb