Chatwoot/app/controllers/api/v1/notification_subscriptions_controller.rb
Sojan Jose 96da27f1f6
Feature: User Notification Objects (#752)
Co-authored-by: Pranav Raj S <pranavrajs@gmail.com>
2020-05-01 14:53:43 +05:30

18 lines
479 B
Ruby

class Api::V1::NotificationSubscriptionsController < Api::BaseController
before_action :set_user
def create
notification_subscription = @user.notification_subscriptions.create(notification_subscription_params)
render json: notification_subscription
end
private
def set_user
@user = current_user
end
def notification_subscription_params
params.require(:notification_subscription).permit(:subscription_type, subscription_attributes: {})
end
end