1acceb941d
Print all links through new uri.js component Refactor the router to use more predictable parsing Fix linking to entities with weird names (that contain slashes, + etc.)
25 lines
700 B
JavaScript
25 lines
700 B
JavaScript
'use strict';
|
|
|
|
const api = require('../api.js');
|
|
const uri = require('../util/uri.js');
|
|
const AbstractList = require('./abstract_list.js');
|
|
const User = require('./user.js');
|
|
|
|
class UserList extends AbstractList {
|
|
static search(text, page) {
|
|
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)}));
|
|
});
|
|
}
|
|
}
|
|
|
|
UserList._itemClass = User;
|
|
UserList._itemName = 'user';
|
|
|
|
module.exports = UserList;
|