Commit fa233964 authored by dixpac's avatar dixpac

Rename Files::DeleteService to Files::DestroyService

Reason for renaming is to comply with naming convention of services in
codebase.
parent 6cbfe139
...@@ -61,10 +61,10 @@ class Projects::BlobController < Projects::ApplicationController ...@@ -61,10 +61,10 @@ class Projects::BlobController < Projects::ApplicationController
end end
def destroy def destroy
create_commit(Files::DeleteService, success_notice: "The file has been successfully deleted.", create_commit(Files::DestroyService, success_notice: "The file has been successfully deleted.",
success_path: namespace_project_tree_path(@project.namespace, @project, @target_branch), success_path: namespace_project_tree_path(@project.namespace, @project, @target_branch),
failure_view: :show, failure_view: :show,
failure_path: namespace_project_blob_path(@project.namespace, @project, @id)) failure_path: namespace_project_blob_path(@project.namespace, @project, @id))
end end
def diff def diff
......
module Files module Files
class DeleteService < Files::BaseService class DestroyService < Files::BaseService
def commit def commit
repository.remove_file( repository.remove_file(
current_user, current_user,
......
---
title: Rename Files::DeleteService to Files::DestroyService
merge_request: 9110
author: dixpac
...@@ -117,7 +117,7 @@ module API ...@@ -117,7 +117,7 @@ module API
authorize! :push_code, user_project authorize! :push_code, user_project
file_params = declared_params(include_missing: false) 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 if result[:status] == :success
status(200) status(200)
......
...@@ -122,7 +122,7 @@ describe Gitlab::Diff::PositionTracer, lib: true do ...@@ -122,7 +122,7 @@ describe Gitlab::Diff::PositionTracer, lib: true do
end end
def delete_file(branch_name, file_name) def delete_file(branch_name, file_name)
Files::DeleteService.new( Files::DestroyService.new(
project, project,
current_user, current_user,
start_branch: branch_name, start_branch: branch_name,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment