mail: add mailbox count route
This commit is contained in:
@@ -1,33 +1,35 @@
|
||||
'use strict';
|
||||
|
||||
exports = module.exports = {
|
||||
getDomain: getDomain,
|
||||
getDomain,
|
||||
|
||||
setDnsRecords: setDnsRecords,
|
||||
setDnsRecords,
|
||||
|
||||
getStatus: getStatus,
|
||||
getStatus,
|
||||
|
||||
setMailFromValidation: setMailFromValidation,
|
||||
setCatchAllAddress: setCatchAllAddress,
|
||||
setMailRelay: setMailRelay,
|
||||
setMailEnabled: setMailEnabled,
|
||||
setMailFromValidation,
|
||||
setCatchAllAddress,
|
||||
setMailRelay,
|
||||
setMailEnabled,
|
||||
|
||||
sendTestMail: sendTestMail,
|
||||
sendTestMail,
|
||||
|
||||
listMailboxes: listMailboxes,
|
||||
getMailbox: getMailbox,
|
||||
addMailbox: addMailbox,
|
||||
updateMailbox: updateMailbox,
|
||||
removeMailbox: removeMailbox,
|
||||
listMailboxes,
|
||||
getMailbox,
|
||||
addMailbox,
|
||||
updateMailbox,
|
||||
removeMailbox,
|
||||
|
||||
getAliases: getAliases,
|
||||
setAliases: setAliases,
|
||||
getAliases,
|
||||
setAliases,
|
||||
|
||||
getLists: getLists,
|
||||
getList: getList,
|
||||
addList: addList,
|
||||
updateList: updateList,
|
||||
removeList: removeList,
|
||||
getLists,
|
||||
getList,
|
||||
addList,
|
||||
updateList,
|
||||
removeList,
|
||||
|
||||
getMailboxCount
|
||||
};
|
||||
|
||||
var assert = require('assert'),
|
||||
@@ -168,6 +170,16 @@ function listMailboxes(req, res, next) {
|
||||
});
|
||||
}
|
||||
|
||||
function getMailboxCount(req, res, next) {
|
||||
assert.strictEqual(typeof req.params.domain, 'string');
|
||||
|
||||
mail.getMailboxCount(req.params.domain, function (error, count) {
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
next(new HttpSuccess(200, { count }));
|
||||
});
|
||||
}
|
||||
|
||||
function getMailbox(req, res, next) {
|
||||
assert.strictEqual(typeof req.params.domain, 'string');
|
||||
assert.strictEqual(typeof req.params.name, 'string');
|
||||
|
||||
Reference in New Issue
Block a user