ember.js icon indicating copy to clipboard operation
ember.js copied to clipboard

Ember.js error: You must include an 'id' for an object passed to 'push'

Open lcherukuri opened this issue 10 years ago • 2 comments

The REST api which i am using to fetch data doesn't give proper json as expected by Ember.js. I don't have id values in data.

[{"objectID":"340907","owner":"Lokesh"},{"objectID":"340908","owner":"Cherukuri"}] so i created a a serializer

serializers/baddata.js

import ApplicationSerializer from './application';

export default ApplicationSerializer.extend({
    primaryKey: 'objectID'
});
models/baddata.js

import DS from 'ember-data';

export default DS.Model.extend({
    objectID: DS.attr('string'),
    owner: DS.attr('string')
});

This did not solve the problem.

lcherukuri avatar Aug 04 '16 02:08 lcherukuri

Wrong repository. Also, issues should be used for reporting bugs. Try using StackOverflow or the Slack channel for help.

btecu avatar Aug 04 '16 04:08 btecu

Hello, @lc4377. I am closing this since it is not an Emberjs bug. Please, go to #-help channel on Slack. If you are not registered, use the Slackin app.

Thank you!

Serabe avatar Aug 04 '16 15:08 Serabe