Skip to content

Commit

Permalink
Update AddToCart.component.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
w3bdesign committed Oct 23, 2024
1 parent 3c20893 commit a23800c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/Product/AddToCart.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ export interface IProductRootObject {
* @param {number} variationId // Variation ID
* @param {boolean} fullWidth // Whether the button should be full-width
*/

const AddToCart = ({
product,
variationId,
Expand Down Expand Up @@ -141,7 +140,6 @@ const AddToCart = ({
// Refetch cart immediately after adding to cart
await refetch();
} catch (error) {
console.error('Error adding to cart:', error);
setRequestError(true);
}
};
Expand All @@ -155,6 +153,12 @@ const AddToCart = ({
>
KJØP
</Button>
{requestError && (
<p>
Det oppstod en feil ved tillegging i handlekurven. Vennligst prøv
igjen.
</p>
)}
</>
);
};
Expand Down

0 comments on commit a23800c

Please sign in to comment.