modify to use redirect_back_or_default function
This commit is contained in:
parent
c3d48f9735
commit
0bfb9cbf38
1 changed files with 1 additions and 5 deletions
|
@ -124,11 +124,7 @@ class ProjectsController < ApplicationController
|
|||
::Projects::DestroyService.new(@project, current_user, {}).execute
|
||||
flash[:alert] = "Project '#{@project.name}' was deleted."
|
||||
|
||||
if request.referer.present? && request.referer.include?('/admin')
|
||||
redirect_to admin_namespaces_projects_path
|
||||
else
|
||||
redirect_to dashboard_projects_path
|
||||
end
|
||||
redirect_back_or_default(default: dashboard_projects_path, options: {})
|
||||
rescue Projects::DestroyService::DestroyError => ex
|
||||
redirect_to edit_project_path(@project), alert: ex.message
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue