api: support the expiry param on all GET requests.

This commit is contained in:
evazion
2019-09-08 15:32:31 -05:00
parent 3f7e05316d
commit 22fd90eee9
7 changed files with 14 additions and 19 deletions

View File

@@ -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