Added: show message if empty webhooks url saved

This commit is contained in:
Ryo SUETSUGU
2019-11-30 14:59:02 +09:00
parent 7174925ea1
commit fa8d8cb34d

View File

@@ -20,9 +20,7 @@ class WebhookSettingsController < ApplicationController
id = params[:webhook_id]
webhook = Webhook.where(:project_id => @project.id).where(:id => id).first
webhook.url = params[:url]
if webhook.url.empty?
webhook.destroy
elsif webhook.save
if webhook.url.blank? ? webhook.destroy : webhook.save
flash[:notice] = l(:notice_successful_update_webhook)
else
flash[:error] = l(:notice_fail_update_webhook)