project_cryptoverse icon indicating copy to clipboard operation
project_cryptoverse copied to clipboard

coinId not working

Open itsswarnim opened this issue 2 years ago • 15 comments

I know that coin ranking API is updated, and now uuid should be used however I updates coinId to uuid in every file it was present. For eg. getCryptoDetails: builder.query({ query: (uuid) => createRequest(/coin/${uuid}) }) })

It still shows undefined please help

itsswarnim avatar Mar 02 '22 07:03 itsswarnim

use this query: (coinId) => createRequest(/coin/${coinId})

MhdiRahimi avatar Mar 06 '22 11:03 MhdiRahimi

The two API calls (GET Coin & GET coin price history) don't work for me neither, I think I have the same issue as @itsswarnim. Could you help pls ?

Here is what I have so far

getCryptoDetails: builder.query({ query: (coinId) => createRequest(/coin/${coinId}`),
}),

getCryptoHistory: builder.query({
  query: ({ coinId, timeperiod }) => createRequest(`coin/${coinId}/history?timeperiod=${timeperiod}`),
}),

Nicoeloy avatar Mar 06 '22 22:03 Nicoeloy

image

Do it this way and cross check your code with mine. It will work as i had the same error!

RichardTimothy1307 avatar Mar 14 '22 07:03 RichardTimothy1307

getCryptoDetails: builder.query({ query: (coinId) => createRequest('/coin/${coinId}'), }) This line of code does not work for me, and the "coinId" is still undefined. Please let me know how to fix this issue, thanks in advance!

Bailong-Huang avatar May 09 '22 03:05 Bailong-Huang

change path '/crypto/:coinId' to '/coin/:uuid' in app.js, cryptocurrencies.jsx, and in all other where you write and in cryptoApi also change than code is work

Sumitmaithani avatar May 10 '22 14:05 Sumitmaithani

change path '/crypto/:coinId' to '/coin/:uuid' in app.js, cryptocurrencies.jsx, and in all other where you write and in cryptoApi also change than code is work

Thanks for your solution. I have changed the path that you mentioned above in app.js, cryptocurrencies.jsx and cryptoApi.js files, but the uuid is still undefined somehow.

If you don't mind, pls take a look at my codes. https://github.com/Bailong-Huang/crptoverse/tree/master/src

🙏

Bailong-Huang avatar May 10 '22 16:05 Bailong-Huang

i cant see your code cause link show 404 err but if uuid is undefined make sure in cryptoApi it lookk like this: getCryptoDetails: builder.query({ query: (uuid) => createRequest(/coin/${uuid}) })

Sumitmaithani avatar May 11 '22 10:05 Sumitmaithani

i cant see your code cause link show 404 err but if uuid is undefined make sure in cryptoApi it lookk like this: getCryptoDetails: builder.query({ query: (uuid) => createRequest(/coin/${uuid}) })

My bad, I forgot to set it to be public. The link should work right now. Well, I have tried this, but it still is undefined. image image

Bailong-Huang avatar May 11 '22 18:05 Bailong-Huang

ok i got it .. in your ../components/Cryptocurries.jsx change this <Link to={/coin/${currency.id}} > to <Link`` to={/coin/${currency.uuid}} >

Sumitmaithani avatar May 12 '22 07:05 Sumitmaithani

ok i got it .. in your ../components/Cryptocurries.jsx change this <Link to={/coin/${currency.id}} > to <Link to={ ``/coin/${currency.uuid}} >

Finally, it works. Thanks for helping me to solve this issue. Appreciation!!

Bailong-Huang avatar May 12 '22 20:05 Bailong-Huang

can someone help me i have the same proleme , att firs coinid was undefined , i did dhe changes that @Sumitmaithani but now the id shows as a string "CryptoDetails razxDUgYGNAdQ"

Omaar99-ev avatar May 17 '22 12:05 Omaar99-ev

@Omaar99-ev send me your github code or check @Bailong-Huang repo his code is working although you can chec my repo also name mekaverse but i used multiple api's for data

Sumitmaithani avatar May 17 '22 16:05 Sumitmaithani

Thanks @Sumitmaithani solved the issue I had !

doriandevtech avatar Aug 23 '22 14:08 doriandevtech

Thank you @Sumitmaithani !

mwendenzuki avatar Aug 26 '22 14:08 mwendenzuki

can someone help me I have the same proleme , att firs coinid was undefined , i did the changes that @Sumitmaithani but now the id shows as a string "CryptoDetails razpDUgYGNAdQ"

SuvamSadhu avatar Feb 10 '23 15:02 SuvamSadhu