From 39c9c5165f5486c6b5940c5c82b9d346019b1767 Mon Sep 17 00:00:00 2001 From: Ian Kelly Date: Mon, 23 Feb 2015 15:35:29 -0800 Subject: [PATCH] id on 301 update --- app/controllers/wh/settings/urls.js | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/app/controllers/wh/settings/urls.js b/app/controllers/wh/settings/urls.js index 3ab43b52..ad07ff30 100644 --- a/app/controllers/wh/settings/urls.js +++ b/app/controllers/wh/settings/urls.js @@ -73,6 +73,7 @@ export default Ember.ArrayController.extend({ saveRedirects: function () { var controller = this; + var siteName = this.get('session.site.name'); controller.set('isSaving', true); // Save redirect rules with ordering (priority) @@ -112,17 +113,21 @@ export default Ember.ArrayController.extend({ }); } - window.ENV.firebaseRoot.child("management/commands/dns/" + controller.get('session.site.name')).set({ - dnsname: controller.get('domain'), - id: uniqueId() - }, function(error) { - if (error) { - reject(error); - } else { - resolve(['Redirect rules saved.', 'Worker signaled.']); - } - }); + var id = uniqueId(); + + window.ENV.firebaseRoot.child("management/sites/" + siteName + "/dns-status/id").set(id, function() { + window.ENV.firebaseRoot.child("management/commands/dns/" + controller.get('session.site.name')).set({ + dnsname: controller.get('domain'), + id: id + }, function(error) { + if (error) { + reject(error); + } else { + resolve(['Redirect rules saved.', 'Worker signaled.']); + } + }); + }); }); } else { return Ember.RSVP.Promise.resolve(['Redirect rules saved.']);