Skip to content

Conversation

@rianperassoli
Copy link

Database registers:
[amount : 150, type: 'deposit'],
[amount : 75, type: 'deposit'],
[amount : 165, type: 'withdraw']

When i have these register on database the reduce of method return a NaN because the typeorm returns string on field amount.
This fix was made to resolve the test case "should be able to show the balance bigger than 0" at the file below.

https://github.com/rianperassoli/ignite-nodejs-challenge-08/blob/134d5825e35a627912a39bca2acbb6d80476b575/src/modules/statements/useCases/getBalance/GetBalanceController.spec.ts

Database registers:
    [amount : 150, type: 'deposit'],
    [amount : 75, type: 'deposit'],
    [amount : 165, type: 'withdraw']

When i have these register on database the reduce of method return a NaN because the typeorm returns string on field amount.
This fix was made to resolve the test case "should be able to show the balance bigger than 0" at the file below.

https://github.com/rianperassoli/ignite-nodejs-challenge-08/blob/134d5825e35a627912a39bca2acbb6d80476b575/src/modules/statements/useCases/getBalance/GetBalanceController.spec.ts
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.

1 participant