mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-10 17:21:38 -05:00
Fix bulk destroy redirect
This commit is contained in:
parent
4d743ae314
commit
6f2486b8ec
1 changed files with 5 additions and 1 deletions
|
|
@ -20,7 +20,7 @@ class PointsController < ApplicationController
|
|||
def bulk_destroy
|
||||
current_user.tracked_points.where(id: params[:point_ids].compact).destroy_all
|
||||
|
||||
redirect_to points_url(params.slice(:start_at, :end_at, :order_by, :import_id)),
|
||||
redirect_to points_url(preserved_params),
|
||||
notice: 'Points were successfully destroyed.',
|
||||
status: :see_other
|
||||
end
|
||||
|
|
@ -58,4 +58,8 @@ class PointsController < ApplicationController
|
|||
def order_by
|
||||
params[:order_by] || 'desc'
|
||||
end
|
||||
|
||||
def preserved_params
|
||||
params.to_enum.to_h.with_indifferent_access.slice(:start_at, :end_at, :order_by, :import_id)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue