-
Notifications
You must be signed in to change notification settings - Fork 43
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
birutaibm
wants to merge
25
commits into
rocketseat-education:master
Choose a base branch
from
birutaibm:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-AXIOS-1579269
…98e03eb17 [Snyk] Security upgrade axios from 0.19.2 to 0.21.3
The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-HERMESENGINE-1727253
…d6f1c8623 [Snyk] Security upgrade react-native from 0.62.2 to 0.65.0
The following vulnerabilities are fixed with a Snyk patch: - https://snyk.io/vuln/SNYK-JS-LODASH-567746
…08848a8d2 [Snyk] Fix for 1 vulnerabilities
The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-NANOID-2332193
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
The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-HERMESENGINE-2342071 - https://snyk.io/vuln/SNYK-JS-SHELLQUOTE-1766506
…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
The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-SHELLQUOTE-1766506
…772a2c38c9 [Snyk] Security upgrade react-native from 0.68.0 to 0.69.0
The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-REACTNATIVEREANIMATED-2949507
The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-GOT-2932019
…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
The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-REACTDEVTOOLSCORE-6023999
The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-AXIOS-6032459
…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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
fromquantity: number;
toquantity?: number;
. Alternatively, you can change line 21 fromaddToCart(item: Product): void;
toaddToCart(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.