修复:批量提交文件参数缺失以及数据为空处理

This commit is contained in:
2022-07-28 13:56:31 +08:00
parent 79a6841bbc
commit 6e54203ebb
2 changed files with 14 additions and 9 deletions

View File

@@ -3,12 +3,16 @@ json.commit do
json.authored_time render_unix_time(@result_object['commit']['author']['date'])
json.commited_time render_unix_time(@result_object['commit']['committer']['date'])
end
json.contents @result_object['contents'].each do |content|
json.name content['name']
json.path content['path']
json.sha content['sha']
json.type content['type']
json.size content['size']
json.encoding content['encoding']
json.content content['content']
if @result_object['contents'].is_a?(Array)
json.contents @result_object['contents'].each do |content|
json.name content['name']
json.path content['path']
json.sha content['sha']
json.type content['type']
json.size content['size']
json.encoding content['encoding']
json.content content['content']
end
else
json.contents []
end