I am able to get data for all coins. However, when I try to get details of specific coin using the uuid, it displays an error in my console yet I can’t seem to find anything wrong with my code. Can someone pls help me out. Thanks
CONSOLE ERROR:
GET https://coinranking1.p.rapidapi.com/coin?/undefined
QUERY CODE:
export const cryptoApi = createApi({
reducerPath: ‘cryptoApi’,
baseQuery: fetchBaseQuery({
baseUrl: ‘https://coinranking1.p.rapidapi.com’,
prepareHeaders: (headers) => {
headers.set(‘X-RapidAPI-Key’, ‘db843c0499mshbc424b11d14f158p130b1cjsn036a2040d96a’)
return headers;
}
}),
endpoints: (builder) => ({
getCryptos: builder.query({
query: (count) => /coins?limit=${count}
}),
getCryptoDetails: builder.query({
query: (coinuuid) => /coin?/${coinuuid}
}),
}),
});
export const { useGetCryptosQuery, useGetCryptoDetailsQuery } = cryptoApi;