ai tags: respect the user's posts-per-page setting on the /ai_tags page.

This commit is contained in:
evazion
2022-06-26 00:36:55 -05:00
parent e5879f0def
commit 97db0e6db3

View File

@@ -4,12 +4,13 @@ class AITagsController < ApplicationController
respond_to :js, :html, :json, :xml
def index
@ai_tags = authorize AITag.visible(CurrentUser.user).paginated_search(params, count_pages: false)
@ai_tags = @ai_tags.includes(:media_asset, :tag, :post) if request.format.html?
limit = params[:limit].presence || CurrentUser.user.per_page
@mode = params.fetch(:mode, "gallery")
@preview_size = params[:size].presence || cookies[:post_preview_size].presence || MediaAssetGalleryComponent::DEFAULT_SIZE
@ai_tags = authorize AITag.visible(CurrentUser.user).paginated_search(params, limit: limit, count_pages: false)
@ai_tags = @ai_tags.includes(:media_asset, :tag, :post) if request.format.html?
respond_with(@ai_tags)
end