-
Notifications
You must be signed in to change notification settings - Fork 13
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
HT5 done #46
base: master
Are you sure you want to change the base?
HT5 done #46
Conversation
} catch (error) { | ||
dispatch({ type: LOAD_REVIEWS + FAILURE, error }); | ||
} | ||
}; | ||
export const loadProducts = (restaurantId) => async (dispatch) => { |
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.
продукты нужно было загрузить через api middleware
const { id, name, menu, reviews } = restaurant; | ||
useEffect(() => { | ||
const allProdArray = Object.keys(allProducts); |
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.
я в своей домашке покажу, как это можно сделать немного красивее
reviews.includes(reviewId) | ||
); | ||
|
||
//todo fix loop |
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.
лучше это сразу попровлять в селекторе averageRatingSelector
<Rate value={rating} /> | ||
const Review = ({ id }) => { | ||
const allUsers = useSelector((state) => usersSelector(state)); | ||
const allReviews = useSelector((state) => state.reviews.entities); |
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.
не забываем использовать селекторы
loadUsers, | ||
}) => { | ||
useEffect(() => { | ||
loadUsers(); |
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.
тут все равно нужно проверку делать на loading, т.к. этот компонент может быть размонтирован и смонтирован повторно
No description provided.