MDL-64264 core_message: use non-deprecated WS for deletion

Also fixed typo in function name.
This commit is contained in:
Mark Nelson
2018-11-29 12:41:57 +08:00
parent df6d0b6d45
commit 44b92ecdfc
4 changed files with 8 additions and 8 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -855,7 +855,7 @@ function(
var newState = StateManager.setLoadingConfirmAction(viewState, true);
return render(newState)
.then(function() {
return Repository.deleteCoversation(viewState.loggedInUserId, getOtherUserId());
return Repository.deleteConversation(viewState.loggedInUserId, viewState.id);
})
.then(function() {
var newState = StateManager.removeMessages(viewState, viewState.messages);
+5 -5
View File
@@ -539,15 +539,15 @@ define(['jquery', 'core/ajax', 'core/notification'], function($, Ajax, Notificat
* Delete a conversation between two users.
*
* @param {int} userId The user to delete messages for
* @param {int} otherUserId The other member of the conversation
* @param {int} conversationId The id of the conversation
* @return {object} jQuery promise
*/
var deleteCoversation = function(userId, otherUserId) {
var deleteConversation = function(userId, conversationId) {
var request = {
methodname: 'core_message_delete_conversation',
methodname: 'core_message_delete_conversations_by_id',
args: {
userid: userId,
otheruserid: otherUserId
conversationids: [conversationId]
}
};
return Ajax.call([request])[0];
@@ -1051,7 +1051,7 @@ define(['jquery', 'core/ajax', 'core/notification'], function($, Ajax, Notificat
savePreferences: savePreferences,
getPreferences: getPreferences,
deleteMessages: deleteMessages,
deleteCoversation: deleteCoversation,
deleteConversation: deleteConversation,
getContactRequests: getContactRequests,
acceptContactRequest: acceptContactRequest,
declineContactRequest: declineContactRequest,