Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4829

Use Ember Data with API that Doesn't Return Id Property

$
0
0

@MichaelR wrote:

Hello,

I’d like to consume the Star Wars API with Ember Data. Specifically, I want this call to work: https://swapi.co/api/people/1/.

However no id property is returned from the response payload. So while the network request is successful (Status 200) I get this error in the console:

Error while processing route: apple Cannot read property 'id' of null TypeError: Cannot read property 'id' of null

I’ve tried to use:

export default DS.RESTSerializer.extend({
    primaryKey: 'name'
});

with no success; I get the same error.

Thanks for your assistance.

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4829

Trending Articles