api: refactor only param.

This commit is contained in:
evazion
2019-09-08 23:28:02 -05:00
parent 24202d51f0
commit 19f2cc1e74
4 changed files with 12 additions and 48 deletions

View File

@@ -9,7 +9,6 @@ class ApplicationController < ActionController::Base
before_action :normalize_search
before_action :api_check
before_action :set_variant
before_action :track_only_param
before_action :enable_cors
after_action :reset_current_user
layout "default"
@@ -28,12 +27,6 @@ class ApplicationController < ActionController::Base
response.headers["Access-Control-Allow-Origin"] = "*"
end
def track_only_param
if params[:only]
RequestStore[:only_param] = params[:only].split(/,/)
end
end
def api_check
return if CurrentUser.is_anonymous? || request.get? || request.head?