clone query object

v1.18.x
barisusakli 8 years ago
parent 1301fb1f34
commit e7ced2457e

@ -1,6 +1,7 @@
'use strict';
var qs = require('querystring');
var _ = require('underscore');
var pagination = {};
@ -37,10 +38,10 @@ pagination.create = function (currentPage, pageCount, queryObj) {
return a - b;
});
queryObj = queryObj || {};
delete queryObj._;
queryObj = _.clone(queryObj || {});
var pages = pagesToShow.map(function (page) {
queryObj.page = page;
return { page: page, active: page === currentPage, qs: qs.stringify(queryObj) };

Loading…
Cancel
Save