-
-
Notifications
You must be signed in to change notification settings - Fork 359
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 | Iryna Lypnyk | Full Stack Assessment | Level 300 #435
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.
This is looking great, good job!
try { | ||
fetch(`${API_URL}/${id}`, { | ||
method: "DELETE", // или 'PUT' | ||
body: JSON.stringify({id}), // данные могут быть 'строкой' или {объектом}! |
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.
You generally don't need to include the same data in both the path and the body - you can probably just put it in one place or the other, as long as the server knows where it's going to read it from :)
} | ||
}; | ||
|
||
const handleOrderChange = (value) => { |
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.
I'm not sure what value this function is adding over just calling setOrder
directly?
const {video: {id, title, url, rating: videoRating, timestamp}, handleDeleteVideo} = props; | ||
const [rating, setRating] = React.useState(videoRating); | ||
|
||
const videoId = url.split("v=")[1].substring(0, 11); |
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.
What's special about the first 11 characters? It may be worth including a comment describing why you're stripping off the end, and why that's the right place to stop.
No description provided.