diff --git a/ui-v2/app/services/data-sink/protocols/http.js b/ui-v2/app/services/data-sink/protocols/http.js index 82999c983..06cd78679 100644 --- a/ui-v2/app/services/data-sink/protocols/http.js +++ b/ui-v2/app/services/data-sink/protocols/http.js @@ -17,8 +17,7 @@ export default Service.extend({ instance = repo.peek(slug); } } - setProperties(instance, data); - return instance; + return setProperties(instance, data); }, persist: function(sink, instance) { const [, , , /*dc*/ /*nspace*/ model] = sink.split('/'); diff --git a/ui-v2/app/services/data-sink/protocols/local-storage.js b/ui-v2/app/services/data-sink/protocols/local-storage.js index 6483b8c33..797fd9e2b 100644 --- a/ui-v2/app/services/data-sink/protocols/local-storage.js +++ b/ui-v2/app/services/data-sink/protocols/local-storage.js @@ -3,12 +3,11 @@ import { setProperties } from '@ember/object'; export default Service.extend({ settings: service('settings'), - prepare: function(sink, data, instance) { - if (data === null || data || '') { + prepare: function(sink, data, instance = {}) { + if (data === null || data === '') { return instance; } - setProperties(instance, data); - return instance; + return setProperties(instance, data); }, persist: function(sink, instance) { const slug = sink.split(':').pop(); diff --git a/ui-v2/app/services/data-sink/service.js b/ui-v2/app/services/data-sink/service.js index 48db37451..e45b6a261 100644 --- a/ui-v2/app/services/data-sink/service.js +++ b/ui-v2/app/services/data-sink/service.js @@ -1,16 +1,7 @@ import Service, { inject as service } from '@ember/service'; const parts = function(uri) { - if (uri.indexOf('://') === -1) { - uri = `data://${uri}`; - } - const url = new URL(uri); - let pathname = url.pathname; - if (pathname.startsWith('//')) { - pathname = pathname.substr(2); - } - const providerName = url.protocol.substr(0, url.protocol.length - 1); - return [providerName, pathname]; + return uri.split('://'); }; export default Service.extend({ data: service('data-sink/protocols/http'),