mail: Add pagination to lists API

Fixes #712
This commit is contained in:
Girish Ramakrishnan
2020-07-05 10:36:17 -07:00
parent f9115f902a
commit 725a19e5b5
4 changed files with 16 additions and 5 deletions
+4 -2
View File
@@ -1165,11 +1165,13 @@ function setAliases(name, domain, aliases, callback) {
});
}
function getLists(domain, callback) {
function getLists(domain, page, perPage, callback) {
assert.strictEqual(typeof domain, 'string');
assert.strictEqual(typeof page, 'number');
assert.strictEqual(typeof perPage, 'number');
assert.strictEqual(typeof callback, 'function');
mailboxdb.getLists(domain, function (error, result) {
mailboxdb.getLists(domain, page, perPage, function (error, result) {
if (error) return callback(error);
callback(null, result);