diff --git a/app/controllers/ajax/subscription_controller.rb b/app/controllers/ajax/subscription_controller.rb deleted file mode 100644 index fd574e78..00000000 --- a/app/controllers/ajax/subscription_controller.rb +++ /dev/null @@ -1,17 +0,0 @@ -class Ajax::SubscriptionController < AjaxController - before_action :authenticate_user! - - def subscribe - params.require :answer - @response[:status] = :okay - result = Subscription.subscribe(current_user, Answer.find(params[:answer])) - @response[:success] = result.present? - end - - def unsubscribe - params.require :answer - @response[:status] = :okay - result = Subscription.unsubscribe(current_user, Answer.find(params[:answer])) - @response[:success] = result&.destroyed? || false - end -end diff --git a/config/routes.rb b/config/routes.rb index 5004d57c..faaabed1 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -128,8 +128,6 @@ Rails.application.routes.draw do post "/create_list", to: "list#create", as: :create_list post "/destroy_list", to: "list#destroy", as: :destroy_list post "/list_membership", to: "list#membership", as: :list_membership - post "/subscribe", to: "subscription#subscribe", as: :subscribe_answer - post "/unsubscribe", to: "subscription#unsubscribe", as: :unsubscribe_answer get "/webpush/key", to: "web_push#key", as: :webpush_key post "/webpush/check", to: "web_push#check", as: :webpush_check post "/webpush", to: "web_push#subscribe", as: :webpush_subscribe