We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
after selecting countries from option I am getting this error
The text was updated successfully, but these errors were encountered:
Could you share your src/api/index.js?
Sorry, something went wrong.
import axios from 'axios';
const url = 'https://covid19.mathdro.id/api';
export const fetchData= async (Country)=>{ let changeableurl=url; if(Country){ changeableurl='${url}/countries/${Country}' } try { const { data: {confirmed,recovered,deaths,lastUpdate}}=await axios.get(changeableurl);
return {confirmed,recovered,deaths,lastUpdate} } catch (error) { return error; }
}
export const fetchDailyData = async () =>{ try { const {data} = await axios.get(${url}/daily); console.log(data); const modifiedData=data.map((dailyData)=>({ confirmed: dailyData.confirmed.total, deaths: dailyData.deaths.total, date: dailyData.reportDate, })); return modifiedData; } catch (error) { return error; } }
${url}/daily
export const fetchcountries = async () =>{ try { const {data:{countries}}= await axios.get('https://covid19.mathdro.id/api/countries') //console.log(response) return countries.map((country) =>country.name) } catch (error) { return error; } } fetchcountries().then(console.log);
if i select any country from country picker then data of country is showing .I think is this error ? pls help fast
No branches or pull requests
after selecting countries from option I am getting this error
The text was updated successfully, but these errors were encountered: