feat: Add actions and API for deleting message via API (#2519)

This commit is contained in:
Nithin David Thomas
2021-06-29 11:19:08 +05:30
committed by GitHub
parent b705eb39e2
commit 044b6872a4
4 changed files with 38 additions and 0 deletions

View File

@@ -178,6 +178,20 @@ const actions = {
commit(types.default.ADD_MESSAGE, message);
},
deleteMessage: async function deleteLabels(
{ commit },
{ conversationId, messageId }
) {
try {
const response = await MessageApi.delete(conversationId, messageId);
const { data } = response;
// The delete message is actually deleting the content.
commit(types.default.ADD_MESSAGE, data);
} catch (error) {
throw new Error(error);
}
},
addConversation({ commit, state, dispatch }, conversation) {
const { currentInbox } = state;
const {