MDL-64264 core_message: use non-deprecated WS for deletion
Also fixed typo in function name.
This commit is contained in:
File diff suppressed because one or more lines are too long
+1
-1
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);
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user