Remove `Ajax::SubscriptionController`
This commit is contained in:
parent
cefb805243
commit
563f834287
|
@ -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
|
|
|
@ -128,8 +128,6 @@ Rails.application.routes.draw do
|
||||||
post "/create_list", to: "list#create", as: :create_list
|
post "/create_list", to: "list#create", as: :create_list
|
||||||
post "/destroy_list", to: "list#destroy", as: :destroy_list
|
post "/destroy_list", to: "list#destroy", as: :destroy_list
|
||||||
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 "/unsubscribe", to: "subscription#unsubscribe", as: :unsubscribe_answer
|
|
||||||
get "/webpush/key", to: "web_push#key", as: :webpush_key
|
get "/webpush/key", to: "web_push#key", as: :webpush_key
|
||||||
post "/webpush/check", to: "web_push#check", as: :webpush_check
|
post "/webpush/check", to: "web_push#check", as: :webpush_check
|
||||||
post "/webpush", to: "web_push#subscribe", as: :webpush_subscribe
|
post "/webpush", to: "web_push#subscribe", as: :webpush_subscribe
|
||||||
|
|
Loading…
Reference in New Issue