mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-02-13 21:33:20 +01:00
Destroy Mute Rules using Turbo Streams
This commit is contained in:
parent
589b753df3
commit
c08ff04738
2 changed files with 15 additions and 3 deletions
|
@ -18,4 +18,17 @@ class Settings::MutesController < ApplicationController
|
||||||
format.html { redirect_to settings_muted_path }
|
format.html { redirect_to settings_muted_path }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
rule = MuteRule.find(params[:id])
|
||||||
|
rule.destroy!
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
format.turbo_stream do
|
||||||
|
render turbo_stream: turbo_stream.remove("rule_#{params[:id]}")
|
||||||
|
end
|
||||||
|
|
||||||
|
format.html { redirect_to settings_muted_path }
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -82,6 +82,8 @@ Rails.application.routes.draw do
|
||||||
post :export, to: "export#create"
|
post :export, to: "export#create"
|
||||||
|
|
||||||
get :muted, to: "mutes#index"
|
get :muted, to: "mutes#index"
|
||||||
|
post :muted, to: "mutes#create"
|
||||||
|
delete "muted/:id", to: "mutes#destroy", as: :muted_destroy
|
||||||
|
|
||||||
get :blocks, to: "blocks#index"
|
get :blocks, to: "blocks#index"
|
||||||
|
|
||||||
|
@ -130,9 +132,6 @@ Rails.application.routes.draw do
|
||||||
post "/list_membership", to: "list#membership", as: :list_membership
|
post "/list_membership", to: "list#membership", as: :list_membership
|
||||||
post "/subscribe", to: "subscription#subscribe", as: :subscribe_answer
|
post "/subscribe", to: "subscription#subscribe", as: :subscribe_answer
|
||||||
post "/unsubscribe", to: "subscription#unsubscribe", as: :unsubscribe_answer
|
post "/unsubscribe", to: "subscription#unsubscribe", as: :unsubscribe_answer
|
||||||
post "/mute", to: "mute_rule#create", as: :create_mute_rule
|
|
||||||
post "/mute/:id", to: "mute_rule#update", as: :update_mute_rule
|
|
||||||
delete "/mute/:id", to: "mute_rule#destroy", as: :delete_mute_rule
|
|
||||||
post "/block_anon", to: "anonymous_block#create", as: :block_anon
|
post "/block_anon", to: "anonymous_block#create", as: :block_anon
|
||||||
delete "/block_anon/:id", to: "anonymous_block#destroy", as: :unblock_anon
|
delete "/block_anon/:id", to: "anonymous_block#destroy", as: :unblock_anon
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue