April 2020
Intermediate to advanced
716 pages
18h 55m
English
The existing user model in the MERN skeleton application will need an educator value that will be set to false by default in order to represent regular users, but that can be set to true to represent the users who are also educators. To add this new field to the user schema, we will add the following code.
mern-classroom/server/models/user.model.js:
educator: { type: Boolean, default: false}
This educator value must be sent to the frontend, with the user details received once the user has successfully signed in, so that the view can be rendered accordingly to show information that is relevant to the educator. To make this change, we need to update the response that was sent back in the signin controller method ...
Read now
Unlock full access