pleroma-fe/src/services/new_api/user_search.js
2019-03-15 11:03:11 -04:00

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