api: support the expiry param on all GET requests.
This commit is contained in:
@@ -44,7 +44,6 @@ class ArtistsController < ApplicationController
|
||||
end
|
||||
format.json do
|
||||
render :json => @artists.to_json(:include => [:urls])
|
||||
expires_in params[:expiry].to_i.days if params[:expiry]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -18,12 +18,7 @@ class PoolsController < ApplicationController
|
||||
|
||||
def index
|
||||
@pools = Pool.includes(:creator).search(search_params).paginate(params[:page], :limit => params[:limit], :search_count => params[:search])
|
||||
respond_with(@pools) do |format|
|
||||
format.json do
|
||||
render json: @pools.to_json
|
||||
expires_in params[:expiry].to_i.days if params[:expiry]
|
||||
end
|
||||
end
|
||||
respond_with(@pools)
|
||||
end
|
||||
|
||||
def gallery
|
||||
|
||||
@@ -21,8 +21,6 @@ class TagsController < ApplicationController
|
||||
@tags = Tag.names_matches_with_aliases(params[:search][:name_matches])
|
||||
end
|
||||
|
||||
expires_in params[:expiry].to_i.days if params[:expiry]
|
||||
|
||||
respond_with(@tags, root: "tags")
|
||||
end
|
||||
|
||||
|
||||
@@ -30,12 +30,7 @@ class UsersController < ApplicationController
|
||||
redirect_to user_path(@user)
|
||||
else
|
||||
@users = User.search(search_params).paginate(params[:page], :limit => params[:limit], :search_count => params[:search])
|
||||
respond_with(@users) do |format|
|
||||
format.json do
|
||||
render json: @users.to_json
|
||||
expires_in params[:expiry].to_i.days if params[:expiry]
|
||||
end
|
||||
end
|
||||
respond_with(@users)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -26,10 +26,6 @@ class WikiPagesController < ApplicationController
|
||||
end
|
||||
end
|
||||
end
|
||||
format.json do
|
||||
render json: @wiki_pages.to_json
|
||||
expires_in params[:expiry].to_i.days if params[:expiry]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user