add page themes for admins

This commit is contained in:
呱呱呱
2023-08-23 17:16:03 +08:00
parent 471fbcace4
commit beeb12c336
21 changed files with 320 additions and 17 deletions

View File

@@ -0,0 +1,17 @@
class Admins::PageThemesQuery < ApplicationQuery
include CustomSortable
attr_reader :params
sort_columns :created_at, default_by: :created_at, default_direction: :desc
def initialize(params)
@params = params
end
def call
language_frame = params[:language_frame].blank? ? [0..99] : params[:language_frame]
page_themes = PageTheme.where(language_frame: language_frame)
custom_sort(page_themes, params[:sort_by], params[:sort_direction])
end
end