(js) Simplify Mailbox service
parent
0f08571a83
commit
d07e254026
|
@ -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;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue