9 lines
227 B
JavaScript
9 lines
227 B
JavaScript
|
import { fetchJSON, removePrefix } from './utils'
|
||
|
|
||
|
export default async function search (url, query) {
|
||
|
url = removePrefix(url)
|
||
|
query = encodeURIComponent(query)
|
||
|
|
||
|
return fetchJSON(`/api/search${url}?query=${query}`, {})
|
||
|
}
|