mailboxes: be explicit about what is exported

This commit is contained in:
Girish Ramakrishnan
2022-02-16 23:10:10 -08:00
parent 9567efeb45
commit 9d8f21f78d
2 changed files with 13 additions and 2 deletions

View File

@@ -449,7 +449,18 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
return console.error('Failed to list mailboxes.', error);
}
var file = new Blob([ JSON.stringify(result, null, 2) ], { type: 'application/json' });
var content = JSON.stringify(result.map(function (mailbox) {
return {
name: mailbox.name,
domain: mailbox.domain,
ownerId: mailbox.ownerId,
ownerType: mailbox.ownerType,
active: mailbox.ative,
aliases: mailbox.aliases
};
}), null, 2);
var file = new Blob([ content ], { type: 'application/json' });
var a = document.createElement('a');
a.href = URL.createObjectURL(file);
a.download = $scope.domain.domain.replaceAll('.','_') + '-mailboxes.json';