Skip to content

Commit

Permalink
fix: remove empty object on cart clear
Browse files Browse the repository at this point in the history
  • Loading branch information
field123 committed May 1, 2024
1 parent f9ca8cd commit fe981df
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,7 @@ export function CheckoutProvider({ children }: CheckoutProviderProps) {
{
onSuccess: async (data) => {
setConfirmationData(data);
state?.id &&
(await mutateClearCart({
cartId: state.id,
}));
await mutateClearCart();
},
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,7 @@ export function StripeCheckoutProvider({ children }: CheckoutProviderProps) {
{
onSuccess: async (data) => {
setConfirmationData(data);
state?.id &&
(await mutateClearCart({
cartId: state.id,
}));
await mutateClearCart();
},
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,7 @@ export function CheckoutProvider({ children }: CheckoutProviderProps) {
{
onSuccess: async (data) => {
setConfirmationData(data);
state?.id &&
(await mutateClearCart({
cartId: state.id,
}));
await mutateClearCart();
},
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,7 @@ export function StripeCheckoutProvider({ children }: CheckoutProviderProps) {
{
onSuccess: async (data) => {
setConfirmationData(data);
state?.id &&
(await mutateClearCart({
cartId: state.id,
}));
await mutateClearCart();
},
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,7 @@ export function CheckoutProvider({ children }: CheckoutProviderProps) {
{
onSuccess: async (data) => {
setConfirmationData(data);
state?.id &&
(await mutateClearCart({
cartId: state.id,
}));
await mutateClearCart();
},
},
);
Expand Down

0 comments on commit fe981df

Please sign in to comment.