fix: project member authorize

This commit is contained in:
yystopf 2021-08-24 17:48:51 +08:00
parent 3caa751d4d
commit 23b8342283
1 changed files with 2 additions and 2 deletions

View File

@ -47,7 +47,7 @@ class MembersController < ApplicationController
end end
def member_exists? def member_exists?
@project.member?(params[:user_id]) @project.members.exists?(user_id: params[:user_id])
end end
def operate! def operate!
@ -59,6 +59,6 @@ class MembersController < ApplicationController
end end
def check_member_not_exists! def check_member_not_exists!
return render_error("user_id为#{params[:user_id]}的用户还不是项目成员") unless @project.member?(params[:user_id]) return render_error("user_id为#{params[:user_id]}的用户还不是项目成员") unless member_exists?
end end
end end