Hi all, i am getting the below message when i try to work on simple example using ember data. please help/suggest how to fix the problem.
WARNING: Encountered “0” in payload, but no model was found for model name “0” (resolved model name using test-emberdata@serializer:rotation-group:.modelNameFromPayloadKey(“0”))
below is the response from api.
[ { “groupIndex”:1, “creativeIds”:[ 1, 2 ] }, { “groupIndex”:2, “creativeIds”:[ 3, 4 ] } ]
code:
model: rotation-group.js.
import DS from ‘ember-data’;
export default DS.Model.extend({
groupIndex: DS.attr('number'),
creativeIds: DS.attr('array')
});
adapter: rotation-group.js
import Ember from ‘ember’;
import DS from ‘ember-data’;
export default DS.RESTAdapter.extend({
findAll: function(store, type, query, record) {
let url = "http://localhost:3000/api/rotationGroups";
return this.ajax(url, 'POST');
}
});
routes/test.js import Ember from ‘ember’;
export default Ember.Route.extend({
model: function(){
return this.store.findAll('rotationGroup')
}
});