ember-ajax icon indicating copy to clipboard operation
ember-ajax copied to clipboard

allow host and namespace be empty

Open artemgurzhii opened this issue 6 years ago • 0 comments

Allow host and namespace be empty strings?

// app/services/ajax.js
export default AjaxService.extend({
  host: 'https://my-awesome-app.com',
  namespace: '/api/v1',
});
// Some controller/component action
this.ajax.request('/some-url', { namespace: '/' });

// Expected: GET 'https://my-awesome-app.com/api/v1/some-url'
// Result:   GET 'https://my-awesome-app.com/api/v1/some-url'


this.ajax.request('/some-url', { namespace: '' });

// Expected: GET 'https://my-awesome-app.com/some-url'
// Result:   GET 'https://my-awesome-app.com/api/v1/some-url'

Is there any reason for not using Ember.isNone check?

artemgurzhii avatar Jan 09 '19 14:01 artemgurzhii