diff --git a/ui-v2/app/controllers/settings.js b/ui-v2/app/controllers/settings.js index 4f01883001..0533a52c51 100644 --- a/ui-v2/app/controllers/settings.js +++ b/ui-v2/app/controllers/settings.js @@ -35,14 +35,14 @@ export default Controller.extend({ switch (target.name) { case 'client[blocking]': set(this, 'item.client.blocking', !blocking); - this.send('update', this.item); + this.send('update', 'client', this.item.client); break; case 'urls[service]': if (typeof get(this, 'item.urls') === 'undefined') { set(this, 'item.urls', {}); } set(this, 'item.urls.service', target.value); - this.send('update', this.item); + this.send('update', 'urls', this.item.urls); break; } }, diff --git a/ui-v2/app/routes/settings.js b/ui-v2/app/routes/settings.js index b168b8c677..22770105c1 100644 --- a/ui-v2/app/routes/settings.js +++ b/ui-v2/app/routes/settings.js @@ -25,11 +25,17 @@ export default Route.extend({ controller.setProperties(model); }, actions: { - update: function(item) { - if (!get(item, 'client.blocking')) { - this.client.abort(); + update: function(slug, item) { + switch (slug) { + case 'client': + if (!get(item, 'client.blocking')) { + this.client.abort(); + } + break; } - this.repo.persist(item); + this.repo.persist({ + [slug]: item, + }); }, }, });