修改项目首页的筛选

This commit is contained in:
sylor_huang@126.com
2020-04-23 14:16:00 +08:00
parent 6a04bb18ab
commit 77c9b8805f
2 changed files with 5 additions and 8 deletions

View File

@@ -7,12 +7,10 @@ class ProjectsController < ApplicationController
def index
is_admin = current_user && current_user&.admin?
scope = Projects::ListQuery.call(params.merge(is_admin: is_admin, user_id: current_user.try(:id)))
scope_ids = scope.pluck(:id)
@total_count = scope_ids.size
@projects = paginate(Project.where(id: scope_ids))
@total_count = scope.size
@projects = paginate(scope)
end
def create