Skip to content

Commit

Permalink
Fix issue with query string parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
DinerIsmail committed Nov 25, 2023
1 parent 22f0d62 commit 6af565e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion hooks/webs/useWebs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export async function fetchWebsHydrate({ published = false } = {}) {
: REMOTE_URL

const response = await fetch(
`${BASE_URL}/api/webs?withListings=true&published=${published}`,
`${BASE_URL}/api/webs?withListings=true&onlyPublished=${published}`,
)
const data: { webs: Web[] } = await response.json()
const { webs } = data
Expand Down
2 changes: 2 additions & 0 deletions pages/api/webs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ const handler = async (
: false

const onlyPublished = req.query.published
? stringToBoolean(req.query.published as string)
: false

try {
const webs: Data['webs'] = await prisma.web.findMany({
Expand Down

1 comment on commit 6af565e

@vercel
Copy link

@vercel vercel bot commented on 6af565e Nov 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.