Skip to content

Commit

Permalink
fixed bugs n3
Browse files Browse the repository at this point in the history
  • Loading branch information
Fourtwerka committed Sep 22, 2024
1 parent 07aebd0 commit f78a205
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/newsPage/NewsPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ const NewsPage = () => {
const fetchNews = async (query) => {
setIsLoading(true);
const url = query
? `https://newsapi.org/v2/everything?q=${query}&apiKey=${API_KEY}`
: `https://newsapi.org/v2/top-headlines?country=us&apiKey=${API_KEY}`;
? `https://newsapi.org/v2/everything?q=${query}&apiKey=${API_KEY}`
: `https://newsapi.org/v2/top-headlines?country=us&apiKey=${API_KEY}`;


try {
const response = await fetch(url);
Expand Down

0 comments on commit f78a205

Please sign in to comment.