Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F324279
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Nov 25, 5:06 AM
Size
1 KB
Mime Type
text/x-diff
Expires
Wed, Nov 27, 5:06 AM (1 d, 14 h)
Engine
blob
Format
Raw Data
Handle
156122
Attached To
rWEBDNS WebDNS (edet4)
View Options
diff --git a/app/controllers/private_controller.rb b/app/controllers/private_controller.rb
index 7666a40..68b859f 100644
--- a/app/controllers/private_controller.rb
+++ b/app/controllers/private_controller.rb
@@ -1,37 +1,39 @@
class PrivateController < ApplicationController
# This a private trusted API
skip_before_action :verify_authenticity_token
# PUT /replace_ds
def replace_ds
parent, child, ds = replace_ds_params.values_at(:parent, :child, :ds)
Domain.replace_ds(parent, child, ds)
render json: { ok: true }
+ rescue ActiveRecord::RecordNotFound
+ render json: { ok: false, msg: 'Domain not found!' }
end
# PUT /trigger_event
def trigger_event
result = Domain
.find_by_name(action_params[:domain])
.fire_state_event(action_params[:event], params[:args])
render json: { ok: result }
end
private
def action_params
params.require(:domain)
params.require(:event)
params.permit(:domain, :event, args: [])
end
def replace_ds_params
params.require(:parent)
params.require(:child)
params.require(:ds)
params.permit(ds: [])
params
end
end
Event Timeline
Log In to Comment