forked from e621ng/e621ng
[IQDB] Remove xhr handling
This commit is contained in:
parent
70dba28cfa
commit
b58865149f
@ -1,6 +1,6 @@
|
||||
class IqdbQueriesController < ApplicationController
|
||||
respond_to :html, :json
|
||||
before_action :detect_xhr, :throttle
|
||||
before_action :throttle
|
||||
|
||||
def show
|
||||
if params[:file]
|
||||
@ -18,10 +18,6 @@ class IqdbQueriesController < ApplicationController
|
||||
end
|
||||
|
||||
respond_with(@matches) do |fmt|
|
||||
fmt.html do |html|
|
||||
html.xhr { render layout: false }
|
||||
end
|
||||
|
||||
fmt.json do
|
||||
render json: @matches, root: "posts"
|
||||
end
|
||||
@ -45,10 +41,4 @@ class IqdbQueriesController < ApplicationController
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def detect_xhr
|
||||
if request.xhr?
|
||||
request.variant = :xhr
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -1 +0,0 @@
|
||||
<%= render "iqdb_queries/matches" %>
|
@ -25,7 +25,7 @@ class IqdbQueriesControllerTest < ActionDispatch::IntegrationTest
|
||||
|
||||
should "render a response" do
|
||||
IqdbProxy.expects(:query_url).with(@url, nil).returns(@mocked_response)
|
||||
get_auth iqdb_queries_path(variant: "xhr"), @user, params: @params
|
||||
get_auth iqdb_queries_path, @user, params: @params
|
||||
assert_select("#post_#{@posts[0].id}")
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user