2018-11-14 19:29:45 +00:00
|
|
|
import utils from './utils.js'
|
2019-03-12 18:18:20 +00:00
|
|
|
import { parseUser } from '../entity_normalizer/entity_normalizer.service.js'
|
2018-11-14 19:29:45 +00:00
|
|
|
|
|
|
|
const search = ({query, store}) => {
|
|
|
|
return utils.request({
|
|
|
|
store,
|
2019-03-12 18:18:20 +00:00
|
|
|
url: '/api/v1/accounts/search',
|
2018-11-14 19:29:45 +00:00
|
|
|
params: {
|
2019-03-12 18:18:20 +00:00
|
|
|
q: query
|
2018-11-14 19:29:45 +00:00
|
|
|
}
|
2019-03-12 18:18:20 +00:00
|
|
|
})
|
|
|
|
.then((data) => data.json())
|
|
|
|
.then((data) => data.map(parseUser))
|
2018-11-14 19:29:45 +00:00
|
|
|
}
|
|
|
|
const UserSearch = {
|
|
|
|
search
|
|
|
|
}
|
|
|
|
|
|
|
|
export default UserSearch
|