Skip to content

Commit

Permalink
Merge pull request #30 from reactioncommerce/fix-mohan-007-anonymousC…
Browse files Browse the repository at this point in the history
…artByCartId

fix: find by _id OR anonymousAccessToken
  • Loading branch information
MohanNarayana authored Oct 26, 2021
2 parents d404250 + cb909c0 commit cc80959
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/queries/anonymousCartByCartId.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,5 @@ export default async function anonymousCartByCartId(context, { cartId, cartToken
throw new ReactionError("invalid-param", "You must provide a cartId");
}

return Cart.findOne({
_id: cartId,
anonymousAccessToken: hashToken(cartToken)
});
return Cart.findOne({ $or: [{ _id: cartId }, { anonymousAccessToken: hashToken(cartToken) }] });
}

0 comments on commit cc80959

Please sign in to comment.