szurubooru/client/js/models/snapshot_list.js

25 lines
728 B
JavaScript
Raw Normal View History

'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 {
2017-02-09 00:48:06 +01:00
static search(text, offset, limit) {
return api.get(uri.formatApiLink(
2020-06-04 20:09:35 +02:00
'snapshots', {query: text, offset: offset, limit: limit}))
.then(response => {
return Promise.resolve(Object.assign(
{},
response,
{results: SnapshotList.fromResponse(response.results)}));
});
}
}
SnapshotList._itemClass = Snapshot;
SnapshotList._itemName = 'snapshot';
module.exports = SnapshotList;