-
-
Notifications
You must be signed in to change notification settings - Fork 358
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
Conversation
…pdated get endpoint in server
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.
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); |
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.
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?
}); | ||
|
||
// GET "/{id}" | ||
app.get("/:id", (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.
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); |
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.
Splice takes as its first argument an index not a value - are you sure this code works?
I updated the server by changing the path for the deployed backend.
No description provided.