Skip to content

Commit

Permalink
Merge pull request #1060 from lpsinger/search-params-default-page
Browse files Browse the repository at this point in the history
Don't add page to search params when on default page (page 1)
  • Loading branch information
dakota002 authored Jun 26, 2023
2 parents dcfdad4 + 8402819 commit 5e3e1b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/routes/circulars/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ function getPageLink(
startDate?: string,
endDate?: string
) {
const searchParams = new URLSearchParams({ page: page.toString() || '1' })
const searchParams = new URLSearchParams()
if (page > 1) searchParams.set('page', page.toString())
if (query) searchParams.set('query', query)
searchParams.set('page', page.toString() || '1')
if (startDate) searchParams.set('startDate', startDate)
if (endDate) searchParams.set('endDate', endDate)
return `?${searchParams.toString()}`
Expand Down

0 comments on commit 5e3e1b0

Please sign in to comment.