Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
Redirect to group page after feature deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
maxprokopiev committed Oct 26, 2018
1 parent 6d16dfb commit b254a10
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/bandiera/gui.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,18 @@ def _put_update_feature_active_toggle

get '/groups/:group_name/features/:feature_name/delete' do |group_name, feature_name|
_get_delete_feature(group_name, feature_name)

group_page_path = "/groups/#{group_name}"
if request.referrer[group_page_path]
redirect group_page_path
else
redirect '/'
end
end

def _get_delete_feature(group_name, feature_name)
feature_service.remove_feature(audit_context, group_name, feature_name)
flash[:success] = 'Feature deleted.'
redirect '/'
end

##
Expand Down

0 comments on commit b254a10

Please sign in to comment.