move aliases route under mailbox

since aliases can now span domains

fixes #577
This commit is contained in:
Girish Ramakrishnan
2020-04-20 18:55:35 -07:00
parent 7f666d9369
commit ff60f5a381
5 changed files with 3 additions and 64 deletions

View File

@@ -8,7 +8,6 @@ exports = module.exports = {
updateList: updateList,
del: del,
listAliases: listAliases,
listMailboxes: listMailboxes,
getLists: getLists,
@@ -323,22 +322,6 @@ function getAliasesForName(name, domain, callback) {
});
}
function listAliases(domain, page, perPage, callback) {
assert.strictEqual(typeof domain, 'string');
assert.strictEqual(typeof page, 'number');
assert.strictEqual(typeof perPage, 'number');
assert.strictEqual(typeof callback, 'function');
database.query(`SELECT ${MAILBOX_FIELDS} FROM mailboxes WHERE domain = ? AND type = ? ORDER BY name LIMIT ${(page-1)*perPage},${perPage}`,
[ domain, exports.TYPE_ALIAS ], function (error, results) {
if (error) return callback(new BoxError(BoxError.DATABASE_ERROR, error));
results.forEach(function (result) { postProcess(result); });
callback(null, results);
});
}
function getAlias(name, domain, callback) {
assert.strictEqual(typeof name, 'string');
assert.strictEqual(typeof domain, 'string');