eventlog getAllPaged is now getByQueryPaged

This commit is contained in:
Johannes Zellner
2016-05-06 17:27:52 +02:00
parent 4fa8ab596b
commit 3af95508f5
4 changed files with 8 additions and 44 deletions
+2 -15
View File
@@ -6,7 +6,6 @@ exports = module.exports = {
add: add,
get: get,
getAllPaged: getAllPaged,
getByQueryPaged: getByQueryPaged,
// keep in sync with webadmin index.js filter
ACTION_ACTIVATE: 'cloudron.activate',
@@ -87,26 +86,14 @@ function get(id, callback) {
});
}
function getAllPaged(page, perPage, callback) {
assert.strictEqual(typeof page, 'number');
assert.strictEqual(typeof perPage, 'number');
assert.strictEqual(typeof callback, 'function');
eventlogdb.getAllPaged(page, perPage, function (error, boxes) {
if (error) return callback(new EventLogError(EventLogError.INTERNAL_ERROR, error));
callback(null, boxes);
});
}
function getByQueryPaged(action, search, page, perPage, callback) {
function getAllPaged(action, search, page, perPage, callback) {
assert(typeof action === 'string' || action === null);
assert(typeof search === 'string' || search === null);
assert.strictEqual(typeof page, 'number');
assert.strictEqual(typeof perPage, 'number');
assert.strictEqual(typeof callback, 'function');
eventlogdb.getByQueryPaged(action, search, page, perPage, function (error, boxes) {
eventlogdb.getAllPaged(action, search, page, perPage, function (error, boxes) {
if (error) return callback(new EventLogError(EventLogError.INTERNAL_ERROR, error));
callback(null, boxes);