Remove dead code

`status` query parameter was used in ProjectsController years ago to
keep the view in its current state after doing actions like delete,
archive, and unarchive. This has not been cleaned up or adapted when
switching from status to filters and is not useful anymore.
pull/11922/head
Christophe Bliard 2 years ago committed by Oliver Günther
parent fc5b44a803
commit b0834002ba
  1. 10
      app/controllers/projects/archive_controller.rb
  2. 8
      app/controllers/projects_controller.rb

@ -45,11 +45,11 @@ class Projects::ArchiveController < ApplicationController
service_call = change_status(status)
if service_call.success?
redirect_to(project_path_with_status)
redirect_to(projects_path)
else
flash[:error] = t(:"error_can_not_#{status}_project",
errors: service_call.errors.full_messages.join(', '))
redirect_back fallback_location: project_path_with_status
redirect_back fallback_location: projects_path
end
end
@ -65,10 +65,4 @@ class Projects::ArchiveController < ApplicationController
when :unarchive then Projects::UnarchiveService
end
end
def project_path_with_status
acceptable_params = params.permit(:status).to_h.compact.select { |_, v| v.present? }
projects_path(acceptable_params)
end
end

@ -89,7 +89,7 @@ class ProjectsController < ApplicationController
flash[:error] = I18n.t('projects.delete.schedule_failed', errors: service_call.errors.full_messages.join("\n"))
end
redirect_to project_path_with_status
redirect_to projects_path
end
def destroy_info
@ -119,12 +119,6 @@ class ProjectsController < ApplicationController
@project = nil
end
def project_path_with_status
acceptable_params = params.permit(:status).to_h.compact.select { |_, v| v.present? }
projects_path(acceptable_params)
end
def load_query
@query = ParamsToQueryService.new(Project, current_user).call(params)

Loading…
Cancel
Save