fedilove-ui/routes/_api/search.js

11 lines
323 B
JavaScript

import { getWithTimeout, paramsString } from '../_utils/ajax'
import { auth, basename } from './utils'
export function search (instanceName, accessToken, query) {
let url = `${basename(instanceName)}/api/v1/search?` + paramsString({
q: query,
resolve: true
})
return getWithTimeout(url, auth(accessToken))
}