Skip to content

Commit

Permalink
Update asyncActions.js
Browse files Browse the repository at this point in the history
The cart context should get the details if any error occurs
  • Loading branch information
indranil-m authored Feb 26, 2021
1 parent 05bb83f commit 3c05d6e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/peregrine/lib/store/actions/cart/asyncActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,10 +347,11 @@ export const getCartDetails = payload => {
try {
const { data } = await fetchCartDetails({
variables: { cartId },
fetchPolicy: 'network-only'
fetchPolicy: 'no-cache',
errorPolicy: 'all'
});
const { cart: details } = data;

details.items = details.items.filter(function (e) {return e != null;});
dispatch(actions.getDetails.receive({ details }));
} catch (error) {
dispatch(actions.getDetails.receive(error));
Expand Down

0 comments on commit 3c05d6e

Please sign in to comment.