Remove subscription ajax controller locales

This commit is contained in:
Andreas Nedbal 2022-07-06 12:48:31 +02:00 committed by Karina Kwiatek
parent e670a50adf
commit 6d4478b7c4
2 changed files with 2 additions and 6 deletions

View File

@ -3,16 +3,14 @@ class Ajax::SubscriptionController < AjaxController
def subscribe def subscribe
params.require :answer params.require :answer
@response[:status] = 418 @response[:status] = :okay
@response[:message] = I18n.t('messages.subscription.torpedo')
state = Subscription.subscribe(current_user, Answer.find(params[:answer])).nil? state = Subscription.subscribe(current_user, Answer.find(params[:answer])).nil?
@response[:success] = state == false @response[:success] = state == false
end end
def unsubscribe def unsubscribe
params.require :answer params.require :answer
@response[:status] = 418 @response[:status] = :okay
@response[:message] = I18n.t('messages.subscription.torpedo')
state = Subscription.unsubscribe(current_user, Answer.find(params[:answer])).nil? state = Subscription.unsubscribe(current_user, Answer.find(params[:answer])).nil?
@response[:success] = state == false @response[:success] = state == false
end end

View File

@ -56,8 +56,6 @@ en:
error: "An error occurred." error: "An error occurred."
parameter_error: "%{parameter} is required." parameter_error: "%{parameter} is required."
noauth: "requires authentication" noauth: "requires authentication"
subscription:
torpedo: "418 I'm a torpedo"
views: views:
locale: locale:
languages: "Languages" languages: "Languages"