Don't require an endpoint for unsubscribe

This was added by mistake earlier. Unsubscribing without an `endpoint` parameter is supposed to remove all subscriptions.
This commit is contained in:
Karina Kwiatek 2023-01-04 16:37:24 +01:00
parent 8770224eff
commit ab338d64a8

View file

@ -42,8 +42,6 @@ class Ajax::WebPushController < AjaxController
end
def unsubscribe # rubocop:disable Metrics/AbcSize
params.require(:endpoint)
removed = if params.key?(:endpoint)
current_user.web_push_subscriptions.where("subscription ->> 'endpoint' = ?", params[:endpoint]).destroy_all
else