diff --git a/src/responses/zone.cr b/src/responses/zone.cr index ef5cf9c..825c60e 100644 --- a/src/responses/zone.cr +++ b/src/responses/zone.cr @@ -70,5 +70,13 @@ class DNSManager::Response end end DNSManager.responses << RRDeleted + + IPC::JSON.message RRAdded, 19 do + property domain : String + property rr : Storage::Zone::ResourceRecord + def initialize(@domain, @rr) + end + end + DNSManager.responses << RRAdded end diff --git a/src/storage.cr b/src/storage.cr index 3d0aa3a..6dbb16a 100644 --- a/src/storage.cr +++ b/src/storage.cr @@ -168,12 +168,14 @@ class DNSManager::Storage end end + puts "RRID before: #{rr.rrid}" zone << rr + puts "RRID after: #{rr.rrid}" # Update the zone. zones_by_domain.update_or_create zone.domain, zone - Response::Success.new + Response::RRAdded.new zone.domain, rr rescue e Baguette::Log.error "trying to add a resource record in domain #{domain}: #{e}" Response::Error.new "error while adding a resource record in domain #{domain}"