As a developer,
I want to have a consistent data model that reflects our applications needs,
So that I know what data to pass and count on
Acceptance Criteria:
[x] Open our mongoose data model that lives in the file userData.js
[x] After password, add a property palettes. It should be an array that contains an object
[x] In the object there should be four properties: outerGradientColor, innerGradientColor, ringColor, and ringName
[x] They should all be of the type String
[x] Re-name the file userData.js to User.js, and create a new folder named models, and move it into that. the structure should look like server/models/User.js
[x] Lastly we need to update our passportConfig.js file. in the passport.deserializeUser function, we are currently just returning username, but now that we're changing our data model, we're going to want all of the user data to be returned. So let's change this function to simply return the whole user object instead of userInformation that just has the username in it.
Note: VSCode should automatically prompt you to update the imports when you make changes to the name and the directory it lives in. If it doesn't, you'll have to update all the imports manually
User Story:
Acceptance Criteria:
mongoose
data model that lives in the fileuserData.js
password
, add a propertypalettes
. It should be an array that contains an objectouterGradientColor
,innerGradientColor
,ringColor
, andringName
String
userData.js
toUser.js
, and create a new folder namedmodels
, and move it into that. the structure should look likeserver/models/User.js
passportConfig.js
file. in thepassport.deserializeUser
function, we are currently just returningusername
, but now that we're changing our data model, we're going to want all of the user data to be returned. So let's change this function to simply return the wholeuser
object instead ofuserInformation
that just has the username in it.Note: VSCode should automatically prompt you to update the imports when you make changes to the name and the directory it lives in. If it doesn't, you'll have to update all the imports manually