mirror of
https://github.com/dolphin-emu/redmine_webhook.git
synced 2026-01-31 01:15:19 +01:00
Merge pull request #30 from suer/treat_error_on_destroy
Added: show message if empty webhooks url saved
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user