Class: Decidim::NotificationsSubscriptionsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/decidim/notifications_subscriptions_controller.rb

Overview

The controller to handle the subscriptions to push notifications

Instance Method Summary collapse

Instance Method Details

#createObject



8
9
10
11
# File 'app/controllers/decidim/notifications_subscriptions_controller.rb', line 8

def create
  Decidim::NotificationsSubscriptionsPersistor.new(current_user).add_subscription(params)
  head :ok
end

#destroyObject



13
14
15
16
# File 'app/controllers/decidim/notifications_subscriptions_controller.rb', line 13

def destroy
  Decidim::NotificationsSubscriptionsPersistor.new(current_user).delete_subscription(params[:auth])
  head :ok
end