feat: Add ability to create a new conversation if the previous conversation is resolved (#2512)

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
Muhsin Keloth
2021-06-30 21:09:44 +05:30
committed by GitHub
parent e6e9916fdb
commit f0f66c7da6
13 changed files with 119 additions and 16 deletions

View File

@@ -1,6 +1,7 @@
import {
SET_CONVERSATION_ATTRIBUTES,
UPDATE_CONVERSATION_ATTRIBUTES,
CLEAR_CONVERSATION_ATTRIBUTES,
} from '../types';
import { getConversationAPI } from '../../api/conversation';
@@ -14,7 +15,7 @@ export const getters = {
};
export const actions = {
get: async ({ commit }) => {
getAttributes: async ({ commit }) => {
try {
const { data } = await getConversationAPI();
const { contact_last_seen_at: lastSeen } = data;
@@ -27,6 +28,9 @@ export const actions = {
update({ commit }, data) {
commit(UPDATE_CONVERSATION_ATTRIBUTES, data);
},
clearConversationAttributes: ({ commit }) => {
commit('CLEAR_CONVERSATION_ATTRIBUTES');
},
};
export const mutations = {
@@ -40,6 +44,10 @@ export const mutations = {
$state.status = data.status;
}
},
[CLEAR_CONVERSATION_ATTRIBUTES]($state) {
$state.id = '';
$state.status = '';
},
};
export default {