feat: priority UI (#6966)
This commit is contained in:
@@ -403,6 +403,27 @@ const actions = {
|
||||
clearConversationFilters({ commit }) {
|
||||
commit(types.CLEAR_CONVERSATION_FILTERS);
|
||||
},
|
||||
|
||||
assignPriority: async ({ dispatch }, { conversationId, priority }) => {
|
||||
try {
|
||||
await ConversationApi.togglePriority({
|
||||
conversationId,
|
||||
priority,
|
||||
});
|
||||
|
||||
dispatch('setCurrentChatPriority', {
|
||||
priority,
|
||||
conversationId,
|
||||
});
|
||||
} catch (error) {
|
||||
// Handle error
|
||||
}
|
||||
},
|
||||
|
||||
setCurrentChatPriority({ commit }, { priority, conversationId }) {
|
||||
commit(types.ASSIGN_PRIORITY, { priority, conversationId });
|
||||
},
|
||||
|
||||
...messageReadActions,
|
||||
...messageTranslateActions,
|
||||
};
|
||||
|
||||
@@ -77,6 +77,11 @@ export const mutations = {
|
||||
Vue.set(chat.meta, 'team', team);
|
||||
},
|
||||
|
||||
[types.ASSIGN_PRIORITY](_state, { priority, conversationId }) {
|
||||
const [chat] = _state.allConversations.filter(c => c.id === conversationId);
|
||||
Vue.set(chat, 'priority', priority);
|
||||
},
|
||||
|
||||
[types.UPDATE_CONVERSATION_CUSTOM_ATTRIBUTES](_state, custom_attributes) {
|
||||
const [chat] = getSelectedChatConversation(_state);
|
||||
Vue.set(chat, 'custom_attributes', custom_attributes);
|
||||
|
||||
Reference in New Issue
Block a user