# frozen_string_literal: true module E621Ws class PoolsController < ApplicationController include ::ApplicationController::CommonAssetRoutes def index limit = (params[:limit]&.to_i || 100).clamp(0, 320) @results = E621::Pool.search(search_params, params[:page]&.to_i, limit) respond_to do |fmt| fmt.json do render(json: @results) end end end def search_params permit_search_params(%i[name_matches description_matches creator_id creator_name is_active category order tags]) end protected def site_domain E621WsRoutes::POOLS_DOMAIN end end end