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

Cryptodetails.jsx not displaying the 24h Volume correctly after the upgrade to Coinranking API v2, only displays as "undefined". #46

Open
PeroyNel opened this issue Jan 19, 2022 · 3 comments

Comments

@PeroyNel
Copy link

After the upgrade to the Coinranking API v2 many features of the app stopped working correctly due to the changes in endpoints. One of these problem areas was the 24h Volume criteria on the Cryptodetails.jsx component.

In order to read the correct item from the API JSON object you need to adjust your code from:

{ title: '24h Volume', value: $ ${cryptoDetails.volume && cryptoDetails.volume}, icon: }

to the following:

{ title: '24h Volume', value: $ ${cryptoDetails?.["24hVolume"] && millify(cryptoDetails?.["24hVolume"])}, icon: }

the change being from 'volume' to '["24hVolume"]' as per the changes in the Coinranking API documentation.

I hope this helps the rest of you who are trying to fix the program after the API update.

@Lucas-Zhang66
Copy link

Man, you saved my day!! finally find out how to fix the api field name start with an number.. lol.. But, this is kind of strange way to write an API. Since, its not follow the syntax.

@DAVIS-PYTH
Copy link

Thanks @PeroyNel

@AHMED-REBII
Copy link

use this instead :
value: $ ${cryptoDetails?.['24hVolume'] && millify(cryptoDetails['24hVolume'])},

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

No branches or pull requests

4 participants