-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
solution #1173
base: master
Are you sure you want to change the base?
solution #1173
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.
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.
Good job 👍
Let's make your code better
src/App.tsx
Outdated
.then(usersFromServer => { | ||
setUsers(usersFromServer); | ||
}) |
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.
.then(usersFromServer => { | |
setUsers(usersFromServer); | |
}) | |
.then(setUsers) |
src/App.tsx
Outdated
}); | ||
}, [selectedUser]); | ||
|
||
//geting COMENTS |
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.
Remove all comments
//geting COMENTS |
src/App.tsx
Outdated
.then(cmnt => { | ||
setComents(cmnt); | ||
}) |
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.
.then(cmnt => { | |
setComents(cmnt); | |
}) | |
.then(setComents) |
src/App.tsx
Outdated
|
||
<Loader /> | ||
const [selectedPostId, setSelectedPostId] = useState<number>(0); | ||
const [coments, setComents] = useState<Comment[]>([]); |
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.
const [coments, setComents] = useState<Comment[]>([]); | |
const [comments, setComments] = useState<Comment[]>([]); |
src/api/user.ts
Outdated
// export const createTodo = ({ name, email, phone }: Omit<User, 'id'>) => { | ||
// return client.post<User>(`/todos`, { name, email, phone }); | ||
// }; | ||
|
||
// export const deleteTodo = (todoId: number) => { | ||
// return client.delete(`/todos/${todoId}`); | ||
// }; | ||
|
||
// export const updateTodo = ({ id, title, completed, userId }: User) => { | ||
// return client.patch<User>(`/todos/${id}`, { title, completed, userId }); | ||
// }; | ||
// Add more methods here |
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.
Remove all comments
src/components/PostDetails.tsx
Outdated
> | ||
<div className="message-header"> | ||
<a href={`mailto:${coment.email}`} data-cy="CommentAuthor"> | ||
{coment.name} |
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.
Use destructuring for coment
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.
Great work! 🔥
DEMO LINK