chore: Add subscription delete API (#3703)

This commit is contained in:
Muhsin Keloth
2022-01-06 21:40:43 +05:30
committed by GitHub
parent a61dae0bb2
commit e1fe4f09bc
3 changed files with 35 additions and 1 deletions

View File

@@ -7,6 +7,12 @@ class Api::V1::NotificationSubscriptionsController < Api::BaseController
render json: notification_subscription
end
def destroy
notification_subscription = NotificationSubscription.where(["subscription_attributes->>'push_token' = ?", params[:push_token]]).first
notification_subscription.destroy
head :ok
end
private
def set_user