Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 404 if component is not found in search #223

Closed
taroj1205 opened this issue Jun 13, 2024 · 0 comments · Fixed by #240
Closed

Add 404 if component is not found in search #223

taroj1205 opened this issue Jun 13, 2024 · 0 comments · Fixed by #240
Labels
enhancement New feature or request

Comments

@taroj1205
Copy link
Member

Subject

404

Description

We should show a 404 if search result is not found.
Also fix the error below when switching between languages.

⨯ pages/search/index.page.tsx (39:18) @ some
 ⨯ TypeError: Cannot read properties of undefined (reading 'some')
    at eval (webpack-internal:///./pages/search/index.page.tsx:34:23)
    at Array.filter (<anonymous>)
    at getServerSideProps (webpack-internal:///./pages/search/index.page.tsx:32:27) {
  page: '/search'
}
  37 |     if (content.type !== "component") return false
  38 |
> 39 |     return labels.some((label) => (content.labels as string[])?.includes(label))
     |                  ^
  40 |   })
  41 |
  42 |   const components = (

Are you willing to participate in the development of this feature and create a pull request?

None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant