jeudi 6 août 2015

How to api call with findQuery in adapter?

Im trying to make an api call from my ember app.

I have an url format like this:

http://ift.tt/1UqCFmv{"title": { "contains" : "" }, "year": "", "active": { "!" : "false" }}

But i dont know how to pass variables title, years, etc to the api call in the adapter.

I already have something like this:

export default DS.ActiveModelAdapter.extend({
namespace: movies,
host: 'http:// xxx.xxx.xxx.xxx’,
buildURL: function(type, id, record){
  console.log("Building URL: ", type);
  var url = this._super(type, id, record);
  console.log("Building URL: ", url);
  return url;
 }
});

I think i need something like findQuery but I dont know how to use it. Can anyone explain?




Aucun commentaire:

Enregistrer un commentaire