| ... | ... | @@ -21,7 +21,7 @@ module API |
|
|
|
attrs = attributes_for_keys [:file_path, :branch_name, :content, :commit_message]
|
|
|
|
branch_name = attrs.delete(:branch_name)
|
|
|
|
file_path = attrs.delete(:file_path)
|
|
|
|
result = ::Files::CreateContext.new(user_project, current_user, attrs, branch_name, file_path).execute
|
|
|
|
result = ::Files::CreateService.new(user_project, current_user, attrs, branch_name, file_path).execute
|
|
|
|
|
|
|
|
if result[:status] == :success
|
|
|
|
status(201)
|
| ... | ... | @@ -51,7 +51,7 @@ module API |
|
|
|
attrs = attributes_for_keys [:file_path, :branch_name, :content, :commit_message]
|
|
|
|
branch_name = attrs.delete(:branch_name)
|
|
|
|
file_path = attrs.delete(:file_path)
|
|
|
|
result = ::Files::UpdateContext.new(user_project, current_user, attrs, branch_name, file_path).execute
|
|
|
|
result = ::Files::UpdateService.new(user_project, current_user, attrs, branch_name, file_path).execute
|
|
|
|
|
|
|
|
if result[:status] == :success
|
|
|
|
status(200)
|
| ... | ... | @@ -81,7 +81,7 @@ module API |
|
|
|
attrs = attributes_for_keys [:file_path, :branch_name, :commit_message]
|
|
|
|
branch_name = attrs.delete(:branch_name)
|
|
|
|
file_path = attrs.delete(:file_path)
|
|
|
|
result = ::Files::DeleteContext.new(user_project, current_user, attrs, branch_name, file_path).execute
|
|
|
|
result = ::Files::DeleteService.new(user_project, current_user, attrs, branch_name, file_path).execute
|
|
|
|
|
|
|
|
if result[:status] == :success
|
|
|
|
status(200)
|
| ... | ... | |
| ... | ... | |