(js) Simplify Mailbox service

pull/110/head
Francis Lachapelle 2015-09-30 11:29:05 -04:00
parent 0f08571a83
commit d07e254026
1 changed files with 6 additions and 12 deletions

View File

@ -493,19 +493,13 @@
* @returns a promise of the HTTP operation * @returns a promise of the HTTP operation
*/ */
Mailbox.prototype.$delete = function() { Mailbox.prototype.$delete = function() {
var _this = this, var _this = this;
deferred = Mailbox.$q.defer(),
promise;
promise = Mailbox.$$resource.remove(this.id); return Mailbox.$$resource.remove(this.id)
.then(function() {
promise.then(function() { _this.$account.$getMailboxes({reload: true});
_this.$account.$getMailboxes({reload: true}); return true;
deferred.resolve(true); });
}, function(data, status) {
deferred.reject(data);
});
return deferred.promise;
}; };
/** /**