Provide select dropdown for app inbox

This commit is contained in:
Johannes Zellner
2021-12-03 11:23:25 +01:00
parent b9b2ebe202
commit e248b2aacf
3 changed files with 53 additions and 50 deletions

View File

@@ -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);