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 | Iryna Lypnyk | Full Stack Assessment | Level 300 #435

Closed
wants to merge 25 commits into from

Conversation

IrynaLypnyk
Copy link

No description provided.

@IrynaLypnyk IrynaLypnyk changed the title London-10 | Iryna Lypnyk | Full Stack Assessment | Level 999 London-10 | Iryna Lypnyk | Full Stack Assessment | Level 300 Sep 18, 2023
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 looking great, good job!

try {
fetch(`${API_URL}/${id}`, {
method: "DELETE", // или 'PUT'
body: JSON.stringify({id}), // данные могут быть 'строкой' или {объектом}!
Copy link
Member

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

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

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.

@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