Skip to content
Snippets Groups Projects
Commit b609ee55 authored by Rémy Coutable's avatar Rémy Coutable
Browse files

Merge branch 'rename_files_delete_service' into 'master'

Rename Files::DeleteService to Files::DestroyService

See merge request !9110
parents edb8ed36 fa233964
No related branches found
No related tags found
1 merge request!1225CE upstream
Loading
Loading
@@ -61,10 +61,10 @@ def preview
end
 
def destroy
create_commit(Files::DeleteService, success_notice: "The file has been successfully deleted.",
success_path: namespace_project_tree_path(@project.namespace, @project, @target_branch),
failure_view: :show,
failure_path: namespace_project_blob_path(@project.namespace, @project, @id))
create_commit(Files::DestroyService, success_notice: "The file has been successfully deleted.",
success_path: namespace_project_tree_path(@project.namespace, @project, @target_branch),
failure_view: :show,
failure_path: namespace_project_blob_path(@project.namespace, @project, @id))
end
 
def diff
Loading
Loading
module Files
class DeleteService < Files::BaseService
class DestroyService < Files::BaseService
def commit
repository.remove_file(
current_user,
Loading
Loading
---
title: Rename Files::DeleteService to Files::DestroyService
merge_request: 9110
author: dixpac
Loading
Loading
@@ -117,7 +117,7 @@ def commit_response(attrs)
authorize! :push_code, user_project
 
file_params = declared_params(include_missing: false)
result = ::Files::DeleteService.new(user_project, current_user, commit_params(file_params)).execute
result = ::Files::DestroyService.new(user_project, current_user, commit_params(file_params)).execute
 
if result[:status] == :success
status(200)
Loading
Loading
Loading
Loading
@@ -122,7 +122,7 @@ def update_file(branch_name, file_name, content)
end
 
def delete_file(branch_name, file_name)
Files::DeleteService.new(
Files::DestroyService.new(
project,
current_user,
start_branch: branch_name,
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment