diff --git a/app/controllers/api/v1/projects/pulls_controller.rb b/app/controllers/api/v1/projects/pulls/pulls_controller.rb similarity index 89% rename from app/controllers/api/v1/projects/pulls_controller.rb rename to app/controllers/api/v1/projects/pulls/pulls_controller.rb index c93cd8bd8..1a7c574d9 100644 --- a/app/controllers/api/v1/projects/pulls_controller.rb +++ b/app/controllers/api/v1/projects/pulls/pulls_controller.rb @@ -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 diff --git a/app/services/api/v1/projects/contents/batch_create_service.rb b/app/services/api/v1/projects/contents/batch_create_service.rb index 464f8eec9..92bd30a99 100644 --- a/app/services/api/v1/projects/contents/batch_create_service.rb +++ b/app/services/api/v1/projects/contents/batch_create_service.rb @@ -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 \ No newline at end of file diff --git a/app/views/api/v1/projects/pulls/index.json.jbuilder b/app/views/api/v1/projects/pulls/pulls/index.json.jbuilder similarity index 100% rename from app/views/api/v1/projects/pulls/index.json.jbuilder rename to app/views/api/v1/projects/pulls/pulls/index.json.jbuilder diff --git a/app/views/api/v1/projects/pulls/show.json.jbuilder b/app/views/api/v1/projects/pulls/pulls/show.json.jbuilder similarity index 100% rename from app/views/api/v1/projects/pulls/show.json.jbuilder rename to app/views/api/v1/projects/pulls/pulls/show.json.jbuilder