fix: Remove the notification subscription if present (#5510)

This commit is contained in:
Tejaswini Chile
2022-09-28 01:06:57 +05:30
committed by GitHub
parent 336c09e072
commit 543854eaa8

View File

@@ -9,7 +9,7 @@ class Api::V1::NotificationSubscriptionsController < Api::BaseController
def destroy
notification_subscription = NotificationSubscription.where(["subscription_attributes->>'push_token' = ?", params[:push_token]]).first
notification_subscription.destroy!
notification_subscription.destroy! if notification_subscription.present?
head :ok
end