reactioncommerce / api-plugin-carts

Carts plugin for the Reaction API
GNU General Public License v3.0
1 stars 14 forks source link

fix: use context schema #31

Closed MohanNarayana closed 2 years ago

MohanNarayana commented 2 years ago

Signed-off-by: Mohan Narayana mohan.narayana@mailchimp.com

Resolves #16 Impact: minor Type: bugfix

Issue

Schema is directly referenced from simpleSchema.js which could cause validation failure upon extending schema.

Solution

The schema should be retrieved from the context

Testing

  1. Add items to cart, change quantity and delete. All actions should work without error.
rc-publisher commented 2 years ago

:tada: This PR is included in version 1.3.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

brent-hoover commented 2 years ago

@MohanNarayana As we discussed I would have really liked to see a test for this. Also would like to understand how you validated that this worked

MohanNarayana commented 2 years ago

@zenweasel The check I was doing in the first place was incorrect. I was looking at what validate() returns, which is always undefined but it handles the errors internally. So no issues with schema or validating. I will write up a test for this script.