-
Notifications
You must be signed in to change notification settings - Fork 30
Caspian PR #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Caspian PR #7
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really good job with this project. You have done a lot! It feels like you had a good time building this project.
I like the mix between a rigid and structured backend as well as well thought of frontend implementations. I really liked the validation and UX part of the password creation
Looking forward to see what you will do with the final project!
This project is approved with VG
// Index for better performance on common queries | ||
thoughtSchema.index({ createdAt: -1 }) // Most recent first | ||
thoughtSchema.index({ hearts: -1 }) // Most liked first | ||
thoughtSchema.index({ category: 1 }) // Category filtering | ||
thoughtSchema.index({ owner: 1 }) // User's thoughts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clever
// Virtual for likes count based on likedBy array length | ||
thoughtSchema.virtual('likesCount').get(function () { | ||
return this.likedBy ? this.likedBy.length : 0 | ||
}) | ||
|
||
// Ensure virtual fields are serialized | ||
thoughtSchema.set('toJSON', { virtuals: true }) | ||
thoughtSchema.set('toObject', { virtuals: true }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make sure that you can explain virtuals if you're using this approach.
if (category) { | ||
query.category = new RegExp(category, 'i') | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i couldnt see this filter in the frontend? maybe you didnt had time to implement it
Render link: https://friendlytwitter-api.onrender.com
Netlify link: https://friendlytwitter.netlify.app/