lib/fanforce/api/utils.rb in fanforce-api-0.14.9 vs lib/fanforce/api/utils.rb in fanforce-api-0.15.0
- old
+ new
@@ -5,32 +5,32 @@
extend Fanforce::API::Utils
def self.included(base) base.extend(self) end
def valid_fanforce_js_request?(params=@params)
return false if !params.is_a?(Hash)
- return false if is_blank?(params[:fanforce_id]) or is_blank?(params[:api_key])
+ return false if is_blank?(params[:organization_id]) or is_blank?(params[:api_key])
return true
end
def valid_fanforce_request?(params=@params)
return false if !params.is_a?(Hash)
- return false if is_blank?(params[:fanforce_id])
+ return false if is_blank?(params[:organization_id])
return false if is_blank?(params[:app_id]) and is_blank?(params[:behavior_plugin_id]) and is_blank?(params[:plugin_id]) and is_blank?(params[:widget_id])
return true
end
def valid_install_request?(params=@params)
return false if !params.is_a?(Hash)
- return false if is_blank?(params[:fanforce_id])
+ return false if is_blank?(params[:organization_id])
return false if is_blank?(params[:app_id]) and is_blank?(params[:behavior_plugin_id]) and is_blank?(params[:plugin_id]) and is_blank?(params[:widget_id])
return false if is_blank?(params[:api_key])
return true
end
def valid_uninstall_request?(params=@params)
return false if !params.is_a?(Hash)
- return false if is_blank?(params[:fanforce_id])
+ return false if is_blank?(params[:organization_id])
return false if is_blank?(params[:app_id]) and is_blank?(params[:behavior_plugin_id]) and is_blank?(params[:plugin_id]) and is_blank?(params[:widget_id])
return false if is_blank?(params[:api_key])
return true
end
@@ -51,14 +51,14 @@
addon_id = params[:plugin_id]
elsif is_present?(params[:widget_id])
addon_type = :widget
addon_id = params[:widget_id]
end
- remove_nil_values(:"#{addon_type}_id" => params[:"#{addon_type}_id"], addon_type: addon_type, addon_id: addon_id, fanforce_id: params[:fanforce_id], fanforce_slug: params[:fanforce_slug], api_key: params[:api_key], session_id: params[:session_id])
+ remove_nil_values(:"#{addon_type}_id" => params[:"#{addon_type}_id"], addon_type: addon_type, addon_id: addon_id, organization_id: params[:organization_id], organization_slug: params[:organization_slug], api_key: params[:api_key], session_id: params[:session_id])
end
def remove_internal_params(params)
- params.clone.delete_if { |k,v| [:app_id, :behavior_plugin_id, :plugin_id, :widget_id, :addon_type, :addon_id, :fanforce_id, :fanforce_slug, :api_key].include? k }
+ params.clone.delete_if { |k,v| [:app_id, :behavior_plugin_id, :plugin_id, :widget_id, :addon_type, :addon_id, :organization_id, :organization_slug, :api_key].include? k }
end
def remove_sensitive_params(params)
params.clone.delete_if { |k,v| [:api_key].include? k }
end