Without using seed data, select roles is blank (in the add team member form, there are no options for select role). This is because the default roles are not set in the backend ( mongo db ) and on app's initialization, it makes an api GET request to /api/roles, which is an empty array.
To resolve this, I've added defaultRoles (intialState) for roles in the reducer, so instead of an empty array, it has the roles array pulled from defaultRoles to work with which is necessary for the SelectRole form to populate the select options. I think either way should be okay, but setting default roles in the backend would be okay too
Fixed.
Without using seed data, select roles is blank (in the add team member form, there are no options for select role). This is because the default roles are not set in the backend ( mongo db ) and on app's initialization, it makes an api GET request to /api/roles, which is an empty array.
To resolve this, I've added defaultRoles (intialState) for roles in the reducer, so instead of an empty array, it has the roles array pulled from defaultRoles to work with which is necessary for the SelectRole form to populate the select options. I think either way should be okay, but setting default roles in the backend would be okay too