Class: Decidim::NotificationsSubscriptionsController

Inherits:
ApplicationController show all
Defined in:
decidim-core/app/controllers/decidim/notifications_subscriptions_controller.rb

Overview

The controller to handle the subscriptions to push notifications

Instance Method Summary collapse

Methods included from UserBlockedChecker

#check_user_block_status, #check_user_not_blocked

Methods included from NeedsSnippets

#snippets

Methods included from Headers::HttpCachingDisabler

#disable_http_caching

Methods included from HasStoredPath

#skip_store_location?, #store_current_location

Methods included from RegistersPermissions

register_permissions

Methods included from NeedsOrganization

enhance_controller, extended, included

Instance Method Details

#createObject



6
7
8
9
# File 'decidim-core/app/controllers/decidim/notifications_subscriptions_controller.rb', line 6

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

#destroyObject



11
12
13
14
# File 'decidim-core/app/controllers/decidim/notifications_subscriptions_controller.rb', line 11

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