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

London 10 | Elena Barker | Full-Stack-Project | Level-300 #428

Closed
wants to merge 34 commits into from

Conversation

ElenaBarker
Copy link

No description provided.

Copy link
Member

@illicitonion illicitonion left a comment

Choose a reason for hiding this comment

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

This is generally looking great, and the code is really clear and easy to read - good job!

import ThumbDown from "@material-ui/icons/ThumbDown";

const CountVotes = () => {
const [likeCount, setLikeCount] = useState(0);
Copy link
Member

Choose a reason for hiding this comment

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

These three pieces of state all only ever change together, which means they maybe could be collapsed into one piece of state (maybe with values "like", "neutral", and "dislike") - what do you think?

server/.env Outdated Show resolved Hide resolved
server/server.js Outdated Show resolved Hide resolved
});

// GET "/{id}"
app.get("/:id", (req, res) => {
Copy link
Member

Choose a reason for hiding this comment

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

It looks like this endpoint and the /videos/:id endpoint didn't get updated to use the database yet?

server/server.js Outdated
const videoId = parseInt(request.params.id);
const singleVideo = videos.find((singleVideo) => singleVideo.id === videoId);
if (singleVideo) {
videos.splice(singleVideo, 1);
Copy link
Member

Choose a reason for hiding this comment

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

Splice takes as its first argument an index not a value - are you sure this code works?

@Dedekind561 Dedekind561 closed this Apr 8, 2024
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