This repository has been archived on 2023-07-01. You can view files and clone it, but cannot push or open issues or pull requests.
4 changed files with
28 additions and
0 deletions
|
|
|
@ -15,6 +15,7 @@ class Settings::KeywordMutesController < Settings::BaseController
|
|
|
|
|
@keyword_mute = keyword_mutes_for_account.create(keyword_mute_params)
|
|
|
|
|
|
|
|
|
|
if @keyword_mute.persisted?
|
|
|
|
|
Glitch::ApplyKeywordMutesWorker.perform_async(current_account.id)
|
|
|
|
|
redirect_to settings_keyword_mutes_path, notice: I18n.t('generic.changes_saved_msg')
|
|
|
|
|
else
|
|
|
|
|
render :new
|
|
|
|
@ -23,6 +24,7 @@ class Settings::KeywordMutesController < Settings::BaseController
|
|
|
|
|
|
|
|
|
|
def update
|
|
|
|
|
if @keyword_mute.update(keyword_mute_params)
|
|
|
|
|
Glitch::ApplyKeywordMutesWorker.perform_async(current_account.id)
|
|
|
|
|
redirect_to settings_keyword_mutes_path, notice: I18n.t('generic.changes_saved_msg')
|
|
|
|
|
else
|
|
|
|
|
render :edit
|
|
|
|
@ -32,12 +34,14 @@ class Settings::KeywordMutesController < Settings::BaseController
|
|
|
|
|
def destroy
|
|
|
|
|
@keyword_mute.destroy!
|
|
|
|
|
|
|
|
|
|
Glitch::ApplyKeywordMutesWorker.perform_async(current_account.id)
|
|
|
|
|
redirect_to settings_keyword_mutes_path, notice: I18n.t('generic.changes_saved_msg')
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def destroy_all
|
|
|
|
|
keyword_mutes_for_account.delete_all
|
|
|
|
|
|
|
|
|
|
Glitch::ApplyKeywordMutesWorker.perform_async(current_account.id)
|
|
|
|
|
redirect_to settings_keyword_mutes_path, notice: I18n.t('generic.changes_saved_msg')
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -0,0 +1,6 @@
|
|
|
|
|
module Glitch
|
|
|
|
|
class ApplyKeywordMutesService < BaseService
|
|
|
|
|
def call(account)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
@ -0,0 +1,13 @@
|
|
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
|
|
module Glitch
|
|
|
|
|
class ApplyKeywordMutesWorker
|
|
|
|
|
include Sidekiq::Worker
|
|
|
|
|
|
|
|
|
|
sidekiq_options unique: :until_executed
|
|
|
|
|
|
|
|
|
|
def perform(account_id)
|
|
|
|
|
Glitch::ApplyKeywordMutesService.new.call(Account.find(account_id))
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
@ -0,0 +1,5 @@
|
|
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
|
|
describe Glitch::ApplyKeywordMutesService, type: :service do
|
|
|
|
|
|
|
|
|
|
end
|