Closed Kenny4297 closed 9 months ago
Thats great, ive done pretty much the same in answer_db_laury branch. Take a look on it, also added on that branch answerController and andsweRoutes, trying to fix few things and test it via Postman
Ah, I missed that you too were working on the issue since nobody was assigned to it.
I like your version of the answer model as well. I'll let you work out the controllers since you already have a good start on it. If you need anything else done that nobody has been working on, add it to the issues tab and I can get started right away!
I will start working on working on task: Send a request from FE to save the answers. I could say in case could start with task: Fe component to show the leaderboard since after i will finish with mine, i will move forward to the task: Create a BE endpoint to fetch the leaderboards. In the meantime could do static FE component
Add Answer Model with ObjectId References
Summary
This PR introduces the
Answer
model for your application, enhancing the way you manage and relate data within your database.Changes
answerSchema
with fields for content, user, and category.mongoose.Schema.Types.ObjectId
foruser
andcategory
fields to establish relational links withUser
andCategory
models.Rationale
mongoose.Schema.Types.ObjectId
is crucial for setting up relations in a MongoDB database. It allows you to reference other documents in the database by their unique IDs, ensuring data integrity and enabling effective data linking and retrieval.Additional Notes
User
andCategory
models.Please let me know if this isn't want you needed, as I have no problem going back and making sure it's perfect.
Thanks for letting me work on this!