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

ikashyntseva: HT7 #88

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

ikashyntseva: HT7 #88

wants to merge 3 commits into from

Conversation

icasinteva
Copy link

No description provided.

@@ -25,7 +26,13 @@ function BasketItem({
<span className={styles.count}>{amount}</span>
<Button onClick={increment} icon="plus" secondary small />
</div>
<p className={cn(styles.count, styles.price)}>{subtotal} $</p>
<p className={cn(styles.count, styles.price)}>
{
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

не очень удобный вариант использования, покажу, как это можно сделать удобнее

dispatch(push(...data));
} catch (error) {
dispatch({ type: SUBMIT_ORDER + FAILURE, error });
dispatch(replace('/error', { error: error.message }));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

этот error уже у вас есть state.checkout.error и лучше его брать оттуда и не использовать состояние роутера

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

точно, я все время забываю что у меня есть в сторе

let data = ['/thankYou'];

if (status !== 'ok') {
action = { type: SUBMIT_ORDER + FAILURE, status };
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
action = { type: SUBMIT_ORDER + FAILURE, status };
action = { type: SUBMIT_ORDER + FAILURE, error: status };

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.

2 participants