fixed 分支操作时项目时间更新
This commit is contained in:
parent
a3e156005f
commit
07f7394172
|
@ -36,11 +36,13 @@ class Api::V1::Projects::BranchesController < Api::V1::BaseController
|
||||||
|
|
||||||
def create
|
def create
|
||||||
@result_object = Api::V1::Projects::Branches::CreateService.call(@project, branch_params, current_user&.gitea_token)
|
@result_object = Api::V1::Projects::Branches::CreateService.call(@project, branch_params, current_user&.gitea_token)
|
||||||
|
@project.update_column(:updated_on, Time.now)
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
@result_object = Api::V1::Projects::Branches::DeleteService.call(@project, params[:name], current_user&.gitea_token)
|
@result_object = Api::V1::Projects::Branches::DeleteService.call(@project, params[:name], current_user&.gitea_token)
|
||||||
if @result_object
|
if @result_object
|
||||||
|
@project.update_column(:updated_on, Time.now)
|
||||||
# 有开启的pr需要一同关闭
|
# 有开启的pr需要一同关闭
|
||||||
# 1、删除本仓库中存在未关闭的pr,即本仓库分支1->分支2
|
# 1、删除本仓库中存在未关闭的pr,即本仓库分支1->分支2
|
||||||
# 2、如果是fork仓库,考虑删除主仓库中存在未关闭的pr,即本仓库:分支1->主:分支2,同时分两种删除:1删除本仓库分支1,2删除主仓库分支2
|
# 2、如果是fork仓库,考虑删除主仓库中存在未关闭的pr,即本仓库:分支1->主:分支2,同时分两种删除:1删除本仓库分支1,2删除主仓库分支2
|
||||||
|
@ -59,6 +61,7 @@ class Api::V1::Projects::BranchesController < Api::V1::BaseController
|
||||||
def restore
|
def restore
|
||||||
@result_object = Api::V1::Projects::Branches::RestoreService.call(@project, params[:branch_id], params[:branch_name], current_user&.gitea_token)
|
@result_object = Api::V1::Projects::Branches::RestoreService.call(@project, params[:branch_id], params[:branch_name], current_user&.gitea_token)
|
||||||
if @result_object
|
if @result_object
|
||||||
|
@project.update_column(:updated_on, Time.now)
|
||||||
return render_ok
|
return render_ok
|
||||||
else
|
else
|
||||||
return render_error('恢复分支失败!')
|
return render_error('恢复分支失败!')
|
||||||
|
@ -70,6 +73,7 @@ class Api::V1::Projects::BranchesController < Api::V1::BaseController
|
||||||
def update_default_branch
|
def update_default_branch
|
||||||
@result_object = Api::V1::Projects::Branches::UpdateDefaultBranchService.call(@project, params[:name], current_user&.gitea_token)
|
@result_object = Api::V1::Projects::Branches::UpdateDefaultBranchService.call(@project, params[:name], current_user&.gitea_token)
|
||||||
if @result_object
|
if @result_object
|
||||||
|
@project.update_column(:updated_on, Time.now)
|
||||||
return render_ok
|
return render_ok
|
||||||
else
|
else
|
||||||
return render_error('更新默认分支失败!')
|
return render_error('更新默认分支失败!')
|
||||||
|
|
Loading…
Reference in New Issue