mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-17 02:05:58 +08:00
修复:批量提交文件参数缺失以及数据为空处理
This commit is contained in:
@@ -13,7 +13,6 @@ class Api::V1::Projects::Contents::BatchCreateService < ApplicationService
|
||||
|
||||
|
||||
def initialize(project, params, token=nil)
|
||||
puts params
|
||||
@project = project
|
||||
@owner = project&.owner.login
|
||||
@repo = project&.identifier
|
||||
@@ -63,6 +62,7 @@ class Api::V1::Projects::Contents::BatchCreateService < ApplicationService
|
||||
committer: Time.at(committer_timeunix.to_i)
|
||||
},
|
||||
message: message,
|
||||
branch: branch,
|
||||
new_branch: new_branch,
|
||||
signoff: false
|
||||
}
|
||||
@@ -77,6 +77,7 @@ class Api::V1::Projects::Contents::BatchCreateService < ApplicationService
|
||||
end
|
||||
|
||||
def excute_data_to_gitea
|
||||
puts request_body.to_json
|
||||
@gitea_data = $gitea_client.post_repos_contents_batch_by_owner_repo(owner, repo, {body: request_body.to_json, query: request_params}) rescue nil
|
||||
raise Error, '创建文件失败!' unless @gitea_data.is_a?(Hash)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user