Feature: Add web push notification permission in frontend (#766)
Add webpush notification permission in frontend Co-authored-by: Sojan <sojan@pepalo.com>
This commit is contained in:
@@ -20,10 +20,11 @@ class Api::V1::Accounts::NotificationSettingsController < Api::BaseController
|
||||
end
|
||||
|
||||
def notification_setting_params
|
||||
params.require(:notification_settings).permit(selected_email_flags: [])
|
||||
params.require(:notification_settings).permit(selected_email_flags: [], selected_push_flags: [])
|
||||
end
|
||||
|
||||
def update_flags
|
||||
@notification_setting.selected_email_flags = notification_setting_params[:selected_email_flags]
|
||||
@notification_setting.selected_push_flags = notification_setting_params[:selected_push_flags]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2,7 +2,8 @@ class Api::V1::NotificationSubscriptionsController < Api::BaseController
|
||||
before_action :set_user
|
||||
|
||||
def create
|
||||
notification_subscription = @user.notification_subscriptions.create(notification_subscription_params)
|
||||
notification_subscription = NotificationSubscriptionBuilder.new(user: @user, params: notification_subscription_params).perform
|
||||
|
||||
render json: notification_subscription
|
||||
end
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ class Api::V1::Widget::ConversationsController < Api::V1::Widget::BaseController
|
||||
before_action :set_contact
|
||||
|
||||
def toggle_typing
|
||||
head :ok if conversation.nil?
|
||||
head :ok && return if conversation.nil?
|
||||
|
||||
if permitted_params[:typing_status] == 'on'
|
||||
trigger_typing_event(CONVERSATION_TYPING_ON)
|
||||
|
||||
Reference in New Issue
Block a user