Skip to content

Conversation

casalm26
Copy link

Copy link

@JennieDalgren JennieDalgren left a 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
image

Looking forward to see what you will do with the final project!

This project is approved with VG

Comment on lines +78 to +82
// 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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clever

Comment on lines +69 to +76
// 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 })

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.

Comment on lines +29 to +31
if (category) {
query.category = new RegExp(category, 'i')
}

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants