Skip to content

Project Happy Thoughts API#507

Open
joheri1 wants to merge 25 commits intoTechnigo:masterfrom
joheri1:master
Open

Project Happy Thoughts API#507
joheri1 wants to merge 25 commits intoTechnigo:masterfrom
joheri1:master

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