13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'app/controllers/zuora_connect/api/v1/app_instance_controller.rb', line 13
def drop
instance_id = @appinstance.id
if session["#{instance_id}::destroy"] && ZuoraConnect::AppInstance.where(:id => instance_id).size != 0
ZuoraConnect::AppInstance.destroy(instance_id)
msg = Apartment::Tenant.drop(instance_id)
respond_to do |format|
message = Hash.new
message = {"error" => {:message => msg.error_message}} if msg.error_message != ""
message["message"] = msg.result_status == 1 ? "success" : "error"
format.json {render :json => message}
end
else
respond_to do |format|
format.json {render :json => { "message" => "Unauthorized"}}
end
end
end
|