make webhook URL removable

This commit is contained in:
Pete Matsyburka
2023-12-02 22:19:24 +02:00
parent ced88476cc
commit 0370e363bc
2 changed files with 4 additions and 2 deletions
@@ -7,7 +7,9 @@ class WebhookSettingsController < ApplicationController
def show; end
def create
@encrypted_config.update!(encrypted_config_params)
@encrypted_config.assign_attributes(encrypted_config_params)
@encrypted_config.value.present? ? @encrypted_config.save! : @encrypted_config.delete
redirect_back(fallback_location: settings_webhooks_path, notice: 'Webhook URL has been saved.')
end