Provide select dropdown for app inbox
This commit is contained in:
@@ -2595,6 +2595,29 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
|
||||
};
|
||||
|
||||
// Mailboxes
|
||||
Client.prototype.getAllMailboxes = function (callback) {
|
||||
var that = this;
|
||||
|
||||
this.getDomains(function (error, domains) {
|
||||
if (error) return callback(error);
|
||||
|
||||
var mailboxes = [];
|
||||
async.eachLimit(domains, 5, function (domain, callback) {
|
||||
that.listMailboxes(domain.domain, '', 1, 1000, function (error, result) {
|
||||
if (error) return callback(error);
|
||||
|
||||
mailboxes = mailboxes.concat(result);
|
||||
|
||||
callback();
|
||||
});
|
||||
}, function (error) {
|
||||
if (error) return callback(error);
|
||||
|
||||
callback(null, mailboxes);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
Client.prototype.getMailboxCount = function (domain, callback) {
|
||||
get('/api/v1/mail/' + domain + '/mailbox_count', null, function (error, data, status) {
|
||||
if (error) return callback(error);
|
||||
|
||||
Reference in New Issue
Block a user