修改项目列表页的显示

This commit is contained in:
sylor_huang@126.com
2020-03-25 18:19:01 +08:00
parent 827ad2f6c5
commit 1cb781ed95
2 changed files with 11 additions and 2 deletions

View File

@@ -6,7 +6,9 @@ class ProjectsController < ApplicationController
before_action :authorizate_user_can_edit_project!, only: %i[update]
def index
scope = Projects::ListQuery.call(params)
is_admin = current_user && current_user&.admin?
scope = Projects::ListQuery.call(params.merge(is_admin: is_admin))
@total_count = scope.size
@projects = paginate(scope)
end