radweb-server
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "radweb-server", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"main":"index.js", | ||
@@ -5,0 +5,0 @@ "Dependencies": { |
@@ -185,11 +185,22 @@ "use strict"; | ||
} | ||
if (options) { | ||
if (options.limit) { | ||
var page = 1; | ||
if (options.page) | ||
page = options.page; | ||
if (page < 1) | ||
page = 1; | ||
select += ' limit ' + options.limit + ' offset ' + (page - 1) * options.limit; | ||
} | ||
} | ||
return r.query(select).then(function (r) { | ||
return radweb_1.pageArray(r.rows, options).map(function (y) { | ||
var result = {}; | ||
for (var x in y) { | ||
var col = colKeys[r.getColumnIndex(x)]; | ||
result[col.jsonName] = col.__getStorage().fromDb(y[x]); | ||
} | ||
return result; | ||
}); | ||
var y = r.rows; | ||
//return pageArray(r.rows, options).map(y => { | ||
var result = {}; | ||
for (var x in y) { | ||
var col = colKeys[r.getColumnIndex(x)]; | ||
result[col.jsonName] = col.__getStorage().fromDb(y[x]); | ||
} | ||
return result; | ||
// }); | ||
}); | ||
@@ -196,0 +207,0 @@ }; |
Sorry, the diff of this file is not supported yet
45483
630