Skip to content

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

Closed
wants to merge 9 commits into from
Closed

Wen's happy thoughts API #485

wants to merge 9 commits into from

Conversation

wwenzz
Copy link

@wwenzz wwenzz commented May 18, 2024

Netlify link

Frontend: https://wen-happy-thoughts.netlify.app/
Backend: https://wen-happy-thoughts-api.onrender.com/

Collaborators

[wwenzz]

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.

Nice job Wen, looks super! Nice that you created dislike functionality as well. Makes sense!

Copy link
Contributor

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,
Copy link
Contributor

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);
Copy link
Contributor

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) => {
Copy link
Contributor

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?

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.

3 participants