Skip to content

Commit

Permalink
Fix coupon code apply
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksandrsKondratjevs committed Sep 30, 2022
1 parent c8d346e commit d886a46
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,13 @@ export class CartCouponContainer extends PureComponent<CartCouponContainerProps,
}

handleApplyCouponToCart(couponCode: string): void {
const { applyCouponToCart, onCouponCodeUpdate } = this.props;
const { applyCouponToCart } = this.props;

this.setState({ isLoading: true });

applyCouponToCart(couponCode).then(
/** @namespace Component/CartCoupon/Container/CartCouponContainer/handleApplyCouponToCart/then/finally/applyCouponToCart/then */
(success) => {
onCouponCodeUpdate();
this.setState({ isIncorrectCoupon: !success });
}
).finally(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export interface CartCouponContainerBaseProps {
couponCode: string;
mix: Mix;
title: string;
onCouponCodeUpdate: () => void;
}

export type CartCouponContainerProps = CartCouponContainerMapStateProps
Expand Down
2 changes: 1 addition & 1 deletion packages/scandipwa/src/util/Request/Request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ export const executePost = async <T>(queryObject: QueryObject): Promise<T> => {
} catch (err) {
handleConnectionError(err, 'executePost failed');

throw new Error(err as string);
throw err;
}
};

Expand Down

0 comments on commit d886a46

Please sign in to comment.