|
|
|
@@ -25,7 +25,6 @@ module Gitea |
|
|
|
def run |
|
|
|
Contents::UpdateForm.new(valid_params).validate! |
|
|
|
response = Gitea::Repository::Entries::UpdateService.new(token, owner, @params[:identifier], file_path, file_params).call |
|
|
|
Rails.logger.info("Gitea::Repository::Entries::UpdateService======#{response.body}") |
|
|
|
render_result(response) |
|
|
|
rescue Exception => exception |
|
|
|
fail!(exception.message) |
|
|
|
@@ -43,6 +42,9 @@ module Gitea |
|
|
|
def render_result(response) |
|
|
|
if response.status == 200 |
|
|
|
@result = JSON.parse(response.body) |
|
|
|
else |
|
|
|
Rails.logger.info("Gitea::Repository::Entries::UpdateService error======#{response.body}") |
|
|
|
@error = "更新失败" |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|