Browse Source

修复:pulls文件夹load

pull/313/head
yystopf 3 years ago
parent
commit
d5c141f892
4 changed files with 2 additions and 2 deletions
  1. +1
    -1
      app/controllers/api/v1/projects/pulls/pulls_controller.rb
  2. +1
    -1
      app/services/api/v1/projects/contents/batch_create_service.rb
  3. +0
    -0
      app/views/api/v1/projects/pulls/pulls/index.json.jbuilder
  4. +0
    -0
      app/views/api/v1/projects/pulls/pulls/show.json.jbuilder

app/controllers/api/v1/projects/pulls_controller.rb → app/controllers/api/v1/projects/pulls/pulls_controller.rb View File

@@ -1,4 +1,4 @@
class Api::V1::Projects::PullsController < Api::V1::BaseController
class Api::V1::Projects::Pulls::PullsController < Api::V1::BaseController
before_action :require_public_and_member_above

def index

+ 1
- 1
app/services/api/v1/projects/contents/batch_create_service.rb View File

@@ -86,7 +86,7 @@ class Api::V1::Projects::Contents::BatchCreateService < ApplicationService
result = $gitea_client.get_repos_branch_name_set_by_owner_repo(owner, repo, {query: request_params} ) rescue nil
raise Error, '查询分支名称失败!' unless result.is_a?(Hash)
raise Error, '分支不存在!' unless result['branch_name'].include?(branch)
raise Error, '分支已存在!' if result['branch_name'].include?(new_branch) && new_branch.nil?
raise Error, '分支已存在!' if result['branch_name'].include?(new_branch) && !new_branch.nil?
end

end

app/views/api/v1/projects/pulls/index.json.jbuilder → app/views/api/v1/projects/pulls/pulls/index.json.jbuilder View File


app/views/api/v1/projects/pulls/show.json.jbuilder → app/views/api/v1/projects/pulls/pulls/show.json.jbuilder View File


Loading…
Cancel
Save