mirror of
https://github.com/urbit/developers.urbit.org.git
synced 2024-09-11 13:55:59 +03:00
components/search: encode all searches
This commit is contained in:
parent
33f570de0c
commit
ffc7b41f9e
@ -58,7 +58,7 @@ class Search extends Component {
|
||||
|
||||
onInputValueChange = debounce(async (query) => {
|
||||
if (query.length) {
|
||||
const search = fetch(this.searchEndpoint(query))
|
||||
const search = fetch(this.searchEndpoint(encodeURIComponent(query)))
|
||||
.then((res) => res.json())
|
||||
.then(async (res) => {
|
||||
// Wrap results in an object which will tell React what component to use to render results.
|
||||
@ -90,7 +90,7 @@ class Search extends Component {
|
||||
]
|
||||
: [];
|
||||
|
||||
const urbitOrgSearch = fetch(this.urbitOrgSearch(query))
|
||||
const urbitOrgSearch = fetch(this.urbitOrgSearch(encodeURIComponent(query)))
|
||||
.then((res) => res.json())
|
||||
.then((res) => {
|
||||
return res.results.map((item) => ({
|
||||
@ -99,7 +99,7 @@ class Search extends Component {
|
||||
}));
|
||||
});
|
||||
|
||||
const opsSearch = fetch(this.opsSearch(query))
|
||||
const opsSearch = fetch(this.opsSearch(encodeURIComponent(query)))
|
||||
.then((res) => res.json())
|
||||
.then((res) => {
|
||||
return [...res.glossary.map((item) => ({
|
||||
|
Loading…
Reference in New Issue
Block a user