From 6d4478b7c4c57d1c90070523e206f6cf6d0d44db Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Wed, 6 Jul 2022 12:48:31 +0200 Subject: [PATCH] Remove subscription ajax controller locales --- app/controllers/ajax/subscription_controller.rb | 6 ++---- config/locales/en.yml | 2 -- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/app/controllers/ajax/subscription_controller.rb b/app/controllers/ajax/subscription_controller.rb index 8d660713..a04520e4 100644 --- a/app/controllers/ajax/subscription_controller.rb +++ b/app/controllers/ajax/subscription_controller.rb @@ -3,16 +3,14 @@ class Ajax::SubscriptionController < AjaxController def subscribe params.require :answer - @response[:status] = 418 - @response[:message] = I18n.t('messages.subscription.torpedo') + @response[:status] = :okay state = Subscription.subscribe(current_user, Answer.find(params[:answer])).nil? @response[:success] = state == false end def unsubscribe params.require :answer - @response[:status] = 418 - @response[:message] = I18n.t('messages.subscription.torpedo') + @response[:status] = :okay state = Subscription.unsubscribe(current_user, Answer.find(params[:answer])).nil? @response[:success] = state == false end diff --git a/config/locales/en.yml b/config/locales/en.yml index edfbfd83..c2b0a8d2 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -56,8 +56,6 @@ en: error: "An error occurred." parameter_error: "%{parameter} is required." noauth: "requires authentication" - subscription: - torpedo: "418 I'm a torpedo" views: locale: languages: "Languages"