Skip to content

Commit

Permalink
fix: use default for limit or page if not valid
Browse files Browse the repository at this point in the history
  • Loading branch information
newarifrh committed Aug 27, 2024
1 parent e7ddd29 commit 42b8cae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pages/ServicePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ const ServicePage = () => {

useEffect(() => {
const initialKeyword = searchParams.get("keyword") || "";
const initialLimit = parseInt(searchParams.get("limit") || "10");
const initialPage = parseInt(searchParams.get("page") || "1");
const initialLimit = parseInt(searchParams.get("limit") || "10") || 10;
const initialPage = parseInt(searchParams.get("page") || "1") || 1;
const initialTags =
searchParams.get("tags") == ""
? []
Expand Down

0 comments on commit 42b8cae

Please sign in to comment.