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

technigo-w15-happy-thoughts-api #475

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

Conversation

schouenkes
Copy link

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 Maja, I just added some small pointers for upcoming backend adventures 🚀


app.post("/thoughts", async (req, res) => {
const { message } = req.body;
const createdAt = new Date();
Copy link
Contributor

Choose a reason for hiding this comment

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

You can have this as a default in your model

}
});

app.get("/thoughts", async (req, res) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

We usually put GET requests before POST requests

Comment on lines +82 to +88
res.status(201).json(likedThought);
} catch (error) {
res.status(400).json({
success: false,
response: error,
message: "You were unable to like the thought",
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be nice if the JSON was structured the same in both blocks

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