rockandrollwithemberjs / rarwe-issues

Errata and updates for the Rock and Roll with Ember.js book
https://rockandrollwithemberjs.com
43 stars 4 forks source link

The saveBand() action before Chapter 9's Making it shippable (version 20211015) #519

Open waihon opened 2 years ago

waihon commented 2 years ago

Before embarking on code refactoring as part of the "Making it shippable" section, I reviewed the source code up to that point and played around with the app.

I encountered an error after adding a new band. Chrome's Console showed below message.

image

I troubleshooted the error and suspected it might be due to the new band's relationships was not set up and passed to the Band's constructor in the saveBand() action (page 119).

image

I've attempted and managed to fix the issue by changing the saveBand() action as follows:

image

May I know whether it was intended not to set up a new band's relationships at that point in time or otherwise?