-
Notifications
You must be signed in to change notification settings - Fork 517
Wen's happy thoughts API #485
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
Conversation
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 job Wen, looks super! Nice that you created dislike functionality as well. Makes sense!
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.
Good idea breaking this out!
type: Number, | ||
default: 0, | ||
required: false, | ||
min: 0, |
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.
Mm, I see what's coming 😉
.sort({ createdAt: -1 }) | ||
.limit(20) | ||
.exec(); | ||
res.json(thoughts); |
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.
A status code would be nice here
}); | ||
|
||
//unlike a post | ||
app.post("/thoughts/:thoughtId/unlike", async (req, res) => { |
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.
Love this! What do you think about having both the like and dislike in the same endpoint though? Maybe some kind of param differing them, since both are changing the likes?
Netlify link
Frontend: https://wen-happy-thoughts.netlify.app/
Backend: https://wen-happy-thoughts-api.onrender.com/
Collaborators
[wwenzz]