Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: addToCart parameter compatibility #1

Open
wants to merge 25 commits into
base: master
Choose a base branch
from

Conversation

birutaibm
Copy link

@birutaibm birutaibm commented Apr 26, 2020

The test was expecting to call the function addToCard with a parameter that has no "quantity" field, but the parameter of this function (at src/hooks/cart.tsx) has the field "quantity" and it is not an optional field.
Another possible solution was change line 16 of src/hooks/cart.tsx from quantity: number; to quantity?: number;. Alternatively, you can change line 21 from addToCart(item: Product): void; to addToCart(item: Omit<Product, 'quantity'>): void;, making it clear that this function need to add always 1 item of the product; if I receive the quantity at the function I suppose I need to consider this information.

birutaibm and others added 25 commits April 26, 2020 08:50
The test was expecting to call the function addToCard with a parameter that has no "quantity" field, but the parameter of this function (at src/hooks/cart.tsx) has the field "quantity" and it is not an optional field.
…98e03eb17

[Snyk] Security upgrade axios from 0.19.2 to 0.21.3
…d6f1c8623

[Snyk] Security upgrade react-native from 0.62.2 to 0.65.0
…08848a8d2

[Snyk] Fix for 1 vulnerabilities
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-NODEFETCH-2342118
…93b9647d1e

[Snyk] Security upgrade json-server from 0.16.1 to 0.16.3
…dc466f40af

[Snyk] Security upgrade react-native-reanimated from 1.8.0 to 2.3.0
…a5b61c9713

[Snyk] Security upgrade react-native from 0.65.0 to 0.68.0
The following vulnerabilities are fixed with a Snyk patch:
- https://snyk.io/vuln/SNYK-JS-LODASH-567746
…e6d2044492

[Snyk] Fix for 1 vulnerabilities
…772a2c38c9

[Snyk] Security upgrade react-native from 0.68.0 to 0.69.0
…e11e051672

[Snyk] Security upgrade react-native-reanimated from 2.5.0 to 2.10.0
…56e4c9be46

[Snyk] Security upgrade json-server from 0.16.3 to 0.17.1
…f2a1e3e03c

[Snyk] Security upgrade react-native from 0.69.0 to 0.71.0
…4676677f86

[Snyk] Security upgrade axios from 0.21.3 to 1.6.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants