Skip to content

Conversation

@alex91-html
Copy link

@alex91-html alex91-html commented Jun 12, 2025

Copy link

@mimmi-eriksson mimmi-eriksson left a comment

Choose a reason for hiding this comment

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

Great work Alex! I see that you still have som things left to do, but I think what you have done so far looks really good. Your code is clean and easy to follow, and all endpoints seems to work as intended, I have left some happy thoughts for you while testing it out :)
Keep up the great work!

// Endpoint to get all thoughts
app.get("/thoughts", async (req, res) => {
try {
const thoughts = await Thought.find().sort({ createdAt: -1 }).limit(20);

Choose a reason for hiding this comment

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

Nice that you use limit() to limit the number of messages that is sent. Would be nice to add this as a query param as well, then the user/frontend can request how many messages they will recieve in the fetch

try {
const updatedThought = await Thought.findByIdAndUpdate(
id,
{ $inc: { hearts: 1 } }, // Increment the hearts count

Choose a reason for hiding this comment

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

Nice with the increment function

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.

Nice looking and well structured code. However, when trying the register I only get a generic failed to register message. I dont know why I failed, Is something broken or didnt I meet the requirements of username or password creation?

image

Waiting for your response before continuing with the review.

@alex91-html
Copy link
Author

alex91-html commented Aug 19, 2025 via email

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.

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.

3 participants