修改后端bug

This commit is contained in:
sylor_huang@126.com 2020-04-03 17:16:38 +08:00
parent d2a15e48a1
commit 973e6646b6
2 changed files with 3 additions and 3 deletions

View File

@ -48,8 +48,8 @@ class ProjectsController < ApplicationController
# projects = Project.visible
# end
#
if params[:user_id].to_i != 2
projects = Project.list_user_projects(params[:user_id])
if current_user&.logged?
projects = Project.list_user_projects(current_user.id)
else
projects = Project.visible
end

View File

@ -17,7 +17,7 @@ class Projects::ListQuery < ApplicationQuery
# else
# projects = Project.visible
# end
if params[:user_id].to_i != 2
if params[:user_id].to_i != 2 && params[:user_id].to_i != 0
projects = Project.list_user_projects(params[:user_id])
else
projects = Project.visible