2016-06-19 19:16:40 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const api = require('../api.js');
|
2017-01-20 21:51:04 +01:00
|
|
|
const uri = require('../util/uri.js');
|
2016-06-19 19:16:40 +02:00
|
|
|
const AbstractList = require('./abstract_list.js');
|
|
|
|
const User = require('./user.js');
|
|
|
|
|
|
|
|
class UserList extends AbstractList {
|
|
|
|
static search(text, page) {
|
2017-01-20 21:51:04 +01:00
|
|
|
return api.get(
|
|
|
|
uri.formatApiLink(
|
|
|
|
'users', {query: text, page: page, pageSize: 30}))
|
|
|
|
.then(response => {
|
|
|
|
return Promise.resolve(Object.assign(
|
|
|
|
{},
|
|
|
|
response,
|
|
|
|
{results: UserList.fromResponse(response.results)}));
|
|
|
|
});
|
2016-06-19 19:16:40 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
UserList._itemClass = User;
|
|
|
|
UserList._itemName = 'user';
|
|
|
|
|
|
|
|
module.exports = UserList;
|