Skip to content

Commit

Permalink
op
Browse files Browse the repository at this point in the history
  • Loading branch information
SH20RAJ authored Mar 21, 2024
1 parent 6789da3 commit 85c4476
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/app/[slug]/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default function ArticlesPage({ params }) {


const [articles, setArticles] = useState([]);
const [page, setPage] = useState(0);
const [page, setPage] = useState(1);
const [isLoading, setIsLoading] = useState(false);
const [filteredArticles, setFilteredArticles] = useState([]);
console.log(params.slug);
Expand All @@ -26,8 +26,7 @@ export default function ArticlesPage({ params }) {
setIsLoading(true);
try {
const response = await fetch(
// `https://dev.to/api/articles?username=${params.slug}&per_page=10&page=${page}`
`https://dev.to/api/articles/latest?username=${params.slug}`
`https://dev.to/api/articles?username=${params.slug}&per_page=100&page=${page}`,{ cache: 'no-store' }
);
const data = await response.json();
setArticles((prevArticles) => [...prevArticles, ...data]);
Expand Down

0 comments on commit 85c4476

Please sign in to comment.