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