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

42 lines
1.0 KiB
JavaScript
Raw Normal View History

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