Skip to content

Nella: Happy API#508

Open
nella-x wants to merge 3 commits intoTechnigo:masterfrom
nella-x:master
Open

Nella: Happy API#508
nella-x wants to merge 3 commits intoTechnigo:masterfrom
nella-x:master

Conversation

@nella-x
Copy link

@nella-x nella-x commented Dec 22, 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.

Good job Nella! 💯

Comment on lines +70 to +73
const updatedThought = await Thought.findByIdAndUpdate(
thoughtId,
{ $inc: { hearts: 1 } }, // Increment hearts by 1
{ new: true } // Return the updated document
Copy link
Contributor

Choose a reason for hiding this comment

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

Comment on lines +86 to +105
// GET /endpoints - Documentation
app.get("/endpoints", (req, res) => {
const apiDocumentation = [
{
path: "/",
methods: ["GET"],
middleware: ["anonymous"],
},
{
path: "/thoughts",
methods: ["GET", "POST"],
middleware: ["anonymous"],
},
{
path: "/thoughts/:thoughtId/like",
methods: ["POST"],
middleware: ["anonymous"],
},
];
res.status(200).json(apiDocumentation);
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