Skip to content
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

Project Happy Thoughts API #507

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open

Project Happy Thoughts API #507

wants to merge 25 commits into from

Conversation

joheri1
Copy link

@joheri1 joheri1 commented Dec 20, 2024

@HIPPIEKICK HIPPIEKICK self-assigned this Jan 9, 2025
Copy link
Contributor

@HIPPIEKICK HIPPIEKICK 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 💪

Copy link
Contributor

Choose a reason for hiding this comment

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

Remove unused code

const { message } = request.body;

try {
const newThought = await HappyThought.create({ message });
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice!

Comment on lines +56 to +58
const updatedThought = await HappyThought.findByIdAndUpdate(thoughtId,
{ $inc: { hearts: 1 } }, // Add 1 heart/like to the thought
{ new: true } // Return the updated thought
Copy link
Contributor

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.

2 participants