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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user