MDL-64274 message: deleteMessages in message_repository return promise
authorRyan Wyllie <ryan@moodle.com>
Thu, 29 Nov 2018 07:03:35 +0000 (15:03 +0800)
committerRyan Wyllie <ryan@moodle.com>
Wed, 5 Dec 2018 06:43:21 +0000 (14:43 +0800)
message/amd/build/message_repository.min.js
message/amd/src/message_repository.js

index 222337f..9f480a6 100644 (file)
Binary files a/message/amd/build/message_repository.min.js and b/message/amd/build/message_repository.min.js differ
index b7bb4d6..a7da2f0 100644 (file)
@@ -524,7 +524,7 @@ define(['jquery', 'core/ajax', 'core/notification'], function($, Ajax, Notificat
      * @return {object} jQuery promise
      */
     var deleteMessages = function(userId, messageIds) {
-        return Ajax.call(messageIds.map(function(messageId) {
+        return $.when.apply(null, Ajax.call(messageIds.map(function(messageId) {
             return {
                 methodname: 'core_message_delete_message',
                 args: {
@@ -532,7 +532,7 @@ define(['jquery', 'core/ajax', 'core/notification'], function($, Ajax, Notificat
                     userid: userId
                 }
             };
-        }));
+        })));
     };
 
     /**