FIX update repositories api

This commit is contained in:
Jasder
2020-03-20 20:15:43 +08:00
parent 551bae911e
commit 3e2b417cce
12 changed files with 83 additions and 62 deletions

View File

@@ -23,7 +23,7 @@ module Gitea
def run
Contents::CreateForm.new(valid_params).validate!
response = Gitea::Repository::Entries::CreateService.new(user, @params[:repo_identifier], @params[:filepath], file_params).call
response = Gitea::Repository::Entries::CreateService.new(user, @params[:identifier], @params[:filepath], file_params).call
render_result(response)
rescue Exception => exception
Rails.logger.info "Exception ===========> #{exception.message}"
@@ -45,8 +45,6 @@ module Gitea
def valid_params
{
login: @params[:login],
repo_identifier: @params[:repo_identifier],
filepath: @params[:filepath],
branch: @params[:branch],
new_branch: @params[:new_branch]

View File

@@ -23,7 +23,7 @@ module Gitea
def run
Contents::DeleteForm.new(valid_params).validate!
response = Gitea::Repository::Entries::DeleteService.new(user, @params[:repo_identifier], @params[:filepath], file_params).call
response = Gitea::Repository::Entries::DeleteService.new(user, @params[:identifier], @params[:filepath], file_params).call
render_result(response)
rescue Exception => exception
fail!(exception.message)
@@ -46,8 +46,6 @@ module Gitea
def valid_params
{
login: @params[:login],
repo_identifier: @params[:repo_identifier],
filepath: @params[:filepath],
sha: @params[:sha]
}

View File

@@ -23,7 +23,7 @@ module Gitea
def run
Contents::UpdateForm.new(valid_params).validate!
response = Gitea::Repository::Entries::UpdateService.new(user, @params[:repo_identifier], @params[:filepath], file_params).call
response = Gitea::Repository::Entries::UpdateService.new(user, @params[:identifier], @params[:filepath], file_params).call
render_result(response)
rescue Exception => exception
fail!(exception.message)
@@ -46,8 +46,6 @@ module Gitea
def valid_params
{
login: @params[:login],
repo_identifier: @params[:repo_identifier],
filepath: @params[:filepath],
branch: @params[:branch],
new_branch: @params[:new_branch],