szurubooru/client/js/models/snapshot_list.js
rr- 1acceb941d client: refactor linking and routing
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.)
2017-01-21 00:13:35 +01:00

24 lines
735 B
JavaScript

'use strict';
const api = require('../api.js');
const uri = require('../util/uri.js');
const AbstractList = require('./abstract_list.js');
const Snapshot = require('./snapshot.js');
class SnapshotList extends AbstractList {
static search(text, page, pageSize) {
return api.get(uri.formatApiLink(
'snapshots', {query: text, page: page, pageSize: pageSize}))
.then(response => {
return Promise.resolve(Object.assign(
{},
response,
{results: SnapshotList.fromResponse(response.results)}));
});
}
}
SnapshotList._itemClass = Snapshot;
SnapshotList._itemName = 'snapshot';
module.exports = SnapshotList;