User Story:
As a developer,
I want to be able to hit a backend route to add a palette to a user,
So that our users data is saved to the DB and can be synced
Acceptance Criteria:
Note: When creating a REST API, the PUT route is used to update an existing document, while POST is used to create a new one.
User Story:
Acceptance Criteria:
PUTroute inindex.jsat the path "/save-palette"async. (Here's a good reference for this)req.userexists, then we want to use thefindOneAndUpdatemethod on ourUserDB modelfindOneAndUpdateDB query.palettesis an array, we can use the mongo$pushoperator to append our new palette to the array rather than replace the whole thing.req.user).Note: When creating a REST API, the
PUTroute is used to update an existing document, whilePOSTis used to create a new one.