mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-20 19:55:56 +08:00
新增:恢复分支接口
新增:删除者信息
This commit is contained in:
@@ -9,7 +9,7 @@ class Api::V1::Projects::BranchesController < Api::V1::BaseController
|
||||
@result_object = Api::V1::Projects::Branches::AllListService.call(@project, current_user&.gitea_token)
|
||||
end
|
||||
|
||||
before_action :require_operate_above, only: [:create, :destroy]
|
||||
before_action :require_operate_above, only: [:create, :destroy, :restore]
|
||||
|
||||
def create
|
||||
@result_object = Api::V1::Projects::Branches::CreateService.call(@project, branch_params, current_user&.gitea_token)
|
||||
@@ -33,6 +33,15 @@ class Api::V1::Projects::BranchesController < Api::V1::BaseController
|
||||
end
|
||||
end
|
||||
|
||||
def restore
|
||||
@result_object = Api::V1::Projects::Branches::RestoreService.call(@project, params[:branch_id], params[:branch_name], current_user&.gitea_token)
|
||||
if @result_object
|
||||
return render_ok
|
||||
else
|
||||
return render_error('恢复分支失败!')
|
||||
end
|
||||
end
|
||||
|
||||
before_action :require_manager_above, only: [:update_default_branch]
|
||||
|
||||
def update_default_branch
|
||||
|
||||
Reference in New Issue
Block a user