-
Notifications
You must be signed in to change notification settings - Fork 31
Alex: js-project-api #5
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?
Conversation
mimmi-eriksson
left a comment
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.
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); |
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.
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 |
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.
Nice with the increment function
JennieDalgren
left a comment
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.
|
Hello!
Thank you for the email, was a problem with MongoDB, now it should work to register, email is not required one can register only with user name.
Hope it works now, looking forward to hear back
Best
Alex
… On 12 Aug 2025, at 17:04, Jennie Dalgren ***@***.***> wrote:
@JennieDalgren requested changes on this pull request.
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.png (view on web) <https://github.com/user-attachments/assets/9d830359-3764-4435-83d0-ed347b43cbd5>
Waiting for your response before continuing with the review.
—
Reply to this email directly, view it on GitHub <#5 (review)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/APARFUKEGVRPLZWTU3N5KID3NH7AJAVCNFSM6AAAAAB7FVVTM6VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTCMJRGI4DCNRRGI>.
You are receiving this because you authored the thread.
|
JennieDalgren
left a comment
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.
✅

✅ DONE
render link: https://alex-js-project-api.onrender.com/
Netlify link: https://happythoughtss.netlify.app/