I am new to ember and javascript.I have to make request to backend api (http://ift.tt/1NS6RkP).But the requests which ember is making is (http://ift.tt/1PeQhl5).Slash is getting removed after PROFILE.How to send the correct request.
adapter.js(profile.js)
import DS from 'ember-data';
export default DS.RESTAdapter.extend({
namespace: 'users',
// token:this.store.find('application',token),
headers:{"Authorization":"token b0fb466a6eac3ad87cd2000580b2192b85ab4"},
host: 'http://example.com/api'
});
model.js(profile.js )
import DS from 'ember-data';
export default DS.Model.extend({
dp_url:DS.attr(),
full_name:DS.attr()
});
Route.js(feed.js)
import Ember from 'ember';
export default Ember.Route.extend({
model(){
var inflector = Ember.Inflector.inflector;
inflector.uncountable('profile');
return this.store.find('profile',{targetuser:-1});
}
});
And is there a way in which I give a different name in this.store.find('different Name').As it get attached to the requests I made to backend.
Aucun commentaire:
Enregistrer un commentaire