新增:路由匹配特殊符号
This commit is contained in:
parent
0800f9e6e0
commit
7c911f5b86
|
@ -16,7 +16,7 @@ class Api::V1::Projects::BranchesController < Api::V1::BaseController
|
|||
end
|
||||
|
||||
def destroy
|
||||
@result_object = Api::V1::Projects::Branches::DeleteService.call(@project, params[:id], current_user&.gitea_token)
|
||||
@result_object = Api::V1::Projects::Branches::DeleteService.call(@project, params[:name], current_user&.gitea_token)
|
||||
if @result_object
|
||||
return render_ok
|
||||
else
|
||||
|
@ -27,7 +27,7 @@ class Api::V1::Projects::BranchesController < Api::V1::BaseController
|
|||
before_action :require_manager_above, only: [:update_default_branch]
|
||||
|
||||
def update_default_branch
|
||||
@result_object = Api::V1::Projects::Branches::UpdateDefaultBranchService.call(@project, params[:default_branch], current_user&.gitea_token)
|
||||
@result_object = Api::V1::Projects::Branches::UpdateDefaultBranchService.call(@project, params[:name], current_user&.gitea_token)
|
||||
if @result_object
|
||||
return render_ok
|
||||
else
|
||||
|
|
|
@ -8,7 +8,7 @@ class Api::V1::Projects::TagsController < Api::V1::BaseController
|
|||
before_action :require_operate_above, only: [:destroy]
|
||||
|
||||
def destroy
|
||||
@result_object = Api::V1::Projects::Tags::DeleteService.call(@project, params[:id], current_user&.gitea_token)
|
||||
@result_object = Api::V1::Projects::Tags::DeleteService.call(@project, params[:name], current_user&.gitea_token)
|
||||
if @result_object
|
||||
return render_ok
|
||||
else
|
||||
|
|
|
@ -17,7 +17,7 @@ class Api::V1::Projects::Tags::DeleteService < ApplicationService
|
|||
def call
|
||||
raise Error, errors.full_messages.join(",") unless valid?
|
||||
|
||||
check_tag_exist
|
||||
# check_tag_exist
|
||||
excute_data_to_gitea
|
||||
|
||||
true
|
||||
|
|
|
@ -46,13 +46,17 @@ defaults format: :json do
|
|||
get :hooktasks
|
||||
end
|
||||
end
|
||||
resources :branches, only:[:index, :create, :destroy] do
|
||||
resources :branches, param: :name, only:[:index, :create, :destroy] do
|
||||
collection do
|
||||
get :all
|
||||
patch :update_default_branch
|
||||
end
|
||||
end
|
||||
resources :tags, only: [:index, :destroy]
|
||||
match 'branches/*name', to: "branches#destroy", via: :all
|
||||
|
||||
resources :tags, param: :name, only: [:index, :destroy]
|
||||
match 'tags/*name', to: "tags#destroy", via: :all
|
||||
|
||||
resources :commits, only: [:index]
|
||||
resources :code_stats, only: [:index]
|
||||
get '/commits/:sha/diff', to: 'commits#diff'
|
||||
|
|
Loading…
Reference in New Issue