forked from AkkomaGang/akkoma-fe
19 lines
390 B
JavaScript
19 lines
390 B
JavaScript
import utils from './utils.js'
|
|
import { parseUser } from '../entity_normalizer/entity_normalizer.service.js'
|
|
|
|
const search = ({query, store}) => {
|
|
return utils.request({
|
|
store,
|
|
url: '/api/v1/accounts/search',
|
|
params: {
|
|
q: query
|
|
}
|
|
})
|
|
.then((data) => data.json())
|
|
.then((data) => data.map(parseUser))
|
|
}
|
|
const UserSearch = {
|
|
search
|
|
}
|
|
|
|
export default UserSearch
|