1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-09 12:32:31 +01:00
Radarr/UI/History/Collection.js

38 lines
949 B
JavaScript
Raw Normal View History

2013-06-22 08:24:24 +02:00
'use strict';
define(['app', 'History/Model', 'backbone.pageable'], function (App, HistoryModel, PageableCollection) {
2013-06-24 04:31:02 +02:00
return PageableCollection.extend({
2013-05-03 08:53:32 +02:00
url : NzbDrone.Constants.ApiRoot + '/history',
model : NzbDrone.History.Model,
state: {
2013-05-24 02:57:34 +02:00
pageSize: 15,
2013-06-22 08:24:24 +02:00
sortKey: 'date',
2013-05-03 08:53:32 +02:00
order: 1
},
queryParams: {
totalPages: null,
totalRecords: null,
pageSize: 'pageSize',
2013-06-22 08:24:24 +02:00
sortKey: 'sortKey',
order: 'sortDir',
2013-05-03 08:53:32 +02:00
directions: {
2013-06-22 08:24:24 +02:00
'-1': 'asc',
'1': 'desc'
2013-05-03 08:53:32 +02:00
}
},
parseState: function (resp, queryParams, state) {
return {totalRecords: resp.totalRecords};
},
parseRecords: function (resp) {
if (resp) {
return resp.records;
}
return resp;
}
});
});