1
0
mirror of https://github.com/oceanprotocol/commons.git synced 2023-03-15 18:03:00 +01:00

fix category search

This commit is contained in:
Matthias Kretschmann 2019-05-23 19:53:20 +02:00
parent 9e15845995
commit f8cff63c79
Signed by: m
GPG Key ID: 606EEEF3C479A91F
2 changed files with 5 additions and 3 deletions

View File

@ -84,7 +84,9 @@ export default class Home extends Component<HomeProps, HomeState> {
.sort((a, b) => a.localeCompare(b)) // sort alphabetically .sort((a, b) => a.localeCompare(b)) // sort alphabetically
.map((category: string) => ( .map((category: string) => (
<Link <Link
to={`/search?categories=${category}`} to={`/search?categories=${encodeURIComponent(
category
)}`}
key={category} key={category}
className={styles.category} className={styles.category}
> >

View File

@ -44,13 +44,13 @@ export default class Search extends PureComponent<SearchProps, SearchState> {
if (text) { if (text) {
await this.setState({ await this.setState({
searchTerm: encodeURIComponent(`${text}`) searchTerm: decodeURIComponent(`${text}`)
}) })
} }
if (categories) { if (categories) {
await this.setState({ await this.setState({
searchCategories: encodeURIComponent(`${categories}`) searchCategories: decodeURIComponent(`${categories}`)
}) })
} }