Open alex-willi opened 1 year ago
Great to hear, I the author model can likely stay as is.
Start to sketch out how to practice, expand your associations. A user could be associate 1:1 with an author, the author 1:M with posts, and a user could be association 1:M with comments.
This author / contributor and user decoupling allows for certain users to become authors without a major refactor of your routes / posts, and only a minor refactor of your authenticated/ protected routes (post CUD ) - specially testing if the person making a request is the author of the post.
Auth is going to be a big next step and would be worth getting all members of your team involved.
Good work team!
I felt good about the back end of this project. I had a little bit of a hard time with the associations but was able to review and figure it out. I we only had to change a couple of things in the back end after i stated it was complete. Like the put route and sub documents. The part I am most proud of was the author schema because i thought I had to include association to the posts in it. I got a better understanding of how it references and removed the sub document. const authorsSchema = new mongoose.Schema({ name: { type: String, unique: true, }, });