Im grabbing json data from a DRF API with ember-data. But the problem is, that ember returns "Error while processing route: equipment data is null" after requesting the data from the api. When i inspect the response with firebug everything seems ok.
equipment.js (models):
import DS from 'ember-data';
export default DS.Model.extend({
Name: DS.attr('string'),
labor: DS.attr('string'),
storeplace: DS.attr('integer'),
fabricator: DS.attr('choice')
});
adapter:
import DS from 'ember-data';
import ENV from 'application/config/environment';
export default DS.JSONAPIAdapter.extend({
host: ENV.host,
namespace: 'api'
});
enviroment.js:
import DS from 'ember-data';
import ENV from 'application/config/environment';
export default DS.JSONAPIAdapter.extend({
host: ENV.host,
namespace: 'api'
});
route:
import Ember from 'ember';
export default Ember.Route.extend({
model() {
return this.store.findAll('equipments');
}
});
if i have forgotten some code you need please comment. thanks in advance
Aucun commentaire:
Enregistrer un commentaire