refact production list

This commit is contained in:
Daniel Herrero 2017-11-09 08:54:41 +01:00
parent 10c52a75b9
commit d2491bfbf4
1 changed files with 1 additions and 4 deletions

View File

@ -2,9 +2,6 @@ module.exports = function(Self) {
Self.defineScope();
Self.list = function(ctx, filter, callback) {
var page = filter.page - 1;
var limit = filter.limit * page;
var offset = (page + 1) * filter.limit;
let daysTickets = 0;
let warehouseFk = filter.where.warehouseFk;
delete filter.limit;
@ -80,7 +77,7 @@ module.exports = function(Self) {
}, this);
obj.m3 = obj.m3.toFixed(2);
obj.total = tickets.length;
obj.tickets = tickets.slice(limit, offset);
obj.tickets = tickets;
return obj;
}
};