(js) Restore immediate deletion of messages

This commit is contained in:
Francis Lachapelle committed 2016-11-01 10:35:00 -04:00
1 parent 67f566ec9d
commit 5c7147cccc
4 files changed
+28 -6

No files matched your search

@@ -676,11 +676,14 @@
* @desc Delete multiple messages from mailbox.
* @return a promise of the HTTP operation
*/
Mailbox.prototype.$deleteMessages = function(messages) {
var _this = this, uids;
Mailbox.prototype.$deleteMessages = function(messages, options) {
var _this = this, uids, data;
uids = _.map(messages, 'uid');
return Mailbox.$$resource.post(this.id, 'batchDelete', {uids: uids})
data = { uids: uids };
if (options) angular.extend(data, options);
return Mailbox.$$resource.post(this.id, 'batchDelete', data)
.then(function(data) {
// Update inbox quota
if (data.quotas)