Heroku service doesn't match app code

In testing the app in chapter 22, I noticed that the web service uses f-name and l-name instead of fname and lname as shown in the code. Sigh. Why would you do that?

Anyway, to get the data to show up as shown in Figure 22.3, you have to change the model in witness.js to:

export default DS.Model.extend({
‘f-name’: DS.attr(‘string’),
‘l-name’: DS.attr(‘string’),
email: DS.attr(‘string’),
sightings: DS.hasMany(‘sighting’),
fullName: Ember.computed(‘f-name’, ‘l-name’, function() {
return this.get(‘f-name’) + ’ ’ + this.get(‘l-name’)
})
});

Most JSON-API plugins follow the convention with dasherized ("my-value") property names. Ember conventions want variables to the camelized (“myValue”) because dashes as key names would need quotes to define them: { “my-value”: 1} vs { myValue: 1}. The JSONAPIAdapter and Serializer should handle the conversion if you keys have capital letters replacing the dash and lowercase letter.