From 18657618bc2be728a5855488762f4dd549c37511 Mon Sep 17 00:00:00 2001 From: prvslnk Date: Wed, 6 Sep 2023 17:23:14 +0530 Subject: [PATCH] Working Fine --- src/components/FetchData.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/FetchData.jsx b/src/components/FetchData.jsx index 7bed972..d2ec1c6 100644 --- a/src/components/FetchData.jsx +++ b/src/components/FetchData.jsx @@ -6,8 +6,8 @@ const FetchData = ({ cat }) => { const fetchdata = async () => { await axios .get( - cat ? `https://newsapi.org/v2/top-headlines?country=in&category=${cat}&apiKey=f463419c4e4c4ebd96549c95688e979b` - : "https://newsapi.org/v2/top-headlines?country=in&apiKey=29fd802688a44af78fadd562ca88adf7" + cat ? `https://saurav.tech/NewsAPI/top-headlines/category/${cat}/in.json` + : "https://saurav.tech/NewsAPI/top-headlines/category/general/in.json" ).then((res) => setData(res.data.articles)); }; useEffect(() => {