diff options
author | Duda Dornelles <ddornell@thoughtworks.com> | 2014-12-18 14:36:10 -0200 |
---|---|---|
committer | Duda Dornelles <ddornell@thoughtworks.com> | 2014-12-18 14:37:14 -0200 |
commit | 8e57412dcd7fe8749ebed645e048309618ed01b5 (patch) | |
tree | d736ae52d3fbffee06e482b19702c78041c83f71 /web-ui/app/js/services | |
parent | 2d07349df9eb7fd3a197c0c3a9f7180af441f82c (diff) |
\#203 & #204 & #205: fixing client and api for buld mark as read/unread and delete, functional tests are still broken, investigating...
Diffstat (limited to 'web-ui/app/js/services')
-rw-r--r-- | web-ui/app/js/services/mail_service.js | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/web-ui/app/js/services/mail_service.js b/web-ui/app/js/services/mail_service.js index 58b70ed7..24bceb31 100644 --- a/web-ui/app/js/services/mail_service.js +++ b/web-ui/app/js/services/mail_service.js @@ -80,13 +80,13 @@ define( mailIdents = _.map(data.checkedMails, function (mail) { return mail.ident; }); - monitoredAjax(this, '/mails/read', { - type: 'POST', - data: {idents: JSON.stringify(mailIdents)} - }).done(this.triggerMailsRead(data.checkedMails)); } else { - monitoredAjax(this, '/mail/' + data.ident + '/read', {type: 'POST'}); + mailIdents = [data.ident]; } + monitoredAjax(this, '/mails/read', { + type: 'POST', + data: JSON.stringify({idents: mailIdents}) + }).done(this.triggerMailsRead(data.checkedMails)); }; this.unreadMail = function (ev, data) { @@ -95,13 +95,13 @@ define( mailIdents = _.map(data.checkedMails, function (mail) { return mail.ident; }); - monitoredAjax(this, '/mails/unread', { - type: 'POST', - data: {idents: JSON.stringify(mailIdents)} - }).done(this.triggerMailsRead(data.checkedMails)); } else { - monitoredAjax(this, '/mail/' + data.ident + '/read', {type: 'POST'}); + mailIdents = [data.ident]; } + monitoredAjax(this, '/mails/unread', { + type: 'POST', + data: JSON.stringify({idents: mailIdents}) + }).done(this.triggerMailsRead(data.checkedMails)); }; this.triggerMailsRead = function (mails) { @@ -137,8 +137,8 @@ define( return mail.ident; }); - monitoredAjax(this, '/mails', { - type: 'DELETE', + monitoredAjax(this, '/mails/delete', { + type: 'POST', dataType: 'json', contentType: 'application/json; charset=utf-8', data: JSON.stringify({idents: mailIdents}) |