From ea4e9e22052ff0c0cccf642fc069093b8a3c1420 Mon Sep 17 00:00:00 2001 From: Karina Kwiatek Date: Wed, 4 Jan 2023 16:37:24 +0100 Subject: [PATCH] Don't require an endpoint for unsubscribe This was added by mistake earlier. Unsubscribing without an `endpoint` parameter is supposed to remove all subscriptions. --- app/controllers/ajax/web_push_controller.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/controllers/ajax/web_push_controller.rb b/app/controllers/ajax/web_push_controller.rb index 220e8300..4dd9ecdd 100644 --- a/app/controllers/ajax/web_push_controller.rb +++ b/app/controllers/ajax/web_push_controller.rb @@ -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