fixed fork后重命名项目标识再forked失败
This commit is contained in:
parent
9763d5c780
commit
ca85975197
|
@ -12,6 +12,9 @@ class ForksController < ApplicationController
|
|||
def authenticate_project!
|
||||
if current_user&.id == @project.user_id
|
||||
render_result(-1, "自己不能fork自己的项目")
|
||||
elsif ForkUser.exists?(fork_project_id: @project.id, user_id: current_user.id)
|
||||
fork = ForkUser.find_by(fork_project_id: @project.id, user_id: current_user.id)
|
||||
render json: { status: -1, identifier: fork.fork_project&.identifier, message: "fork失败,你已拥有了这个项目" }
|
||||
elsif Project.exists?(user_id: current_user.id, identifier: @project.identifier)
|
||||
render_result(0, "fork失败,你已拥有了这个项目")
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue