mirror of
https://github.com/lingble/chatwoot.git
synced 2025-10-29 18:22:53 +00:00
Fixes https://github.com/chatwoot/chatwoot/issues/8436 Fixes https://github.com/chatwoot/chatwoot/issues/9767 Fixes https://github.com/chatwoot/chatwoot/issues/10156 Fixes https://github.com/chatwoot/chatwoot/issues/6031 Fixes https://github.com/chatwoot/chatwoot/issues/5696 Fixes https://github.com/chatwoot/chatwoot/issues/9250 Fixes https://github.com/chatwoot/chatwoot/issues/9762 --------- Co-authored-by: Pranav <pranavrajs@gmail.com> Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
53 lines
994 B
JavaScript
53 lines
994 B
JavaScript
import types from '../mutation-types';
|
|
import ConversationApi from '../../api/inbox/conversation';
|
|
|
|
const state = {
|
|
mineCount: 0,
|
|
unAssignedCount: 0,
|
|
allCount: 0,
|
|
};
|
|
|
|
export const getters = {
|
|
getStats: $state => $state,
|
|
};
|
|
|
|
export const actions = {
|
|
get: async ({ commit }, params) => {
|
|
try {
|
|
const response = await ConversationApi.meta(params);
|
|
const {
|
|
data: { meta },
|
|
} = response;
|
|
commit(types.SET_CONV_TAB_META, meta);
|
|
} catch (error) {
|
|
// Ignore error
|
|
}
|
|
},
|
|
set({ commit }, meta) {
|
|
commit(types.SET_CONV_TAB_META, meta);
|
|
},
|
|
};
|
|
|
|
export const mutations = {
|
|
[types.SET_CONV_TAB_META](
|
|
$state,
|
|
{
|
|
mine_count: mineCount,
|
|
unassigned_count: unAssignedCount,
|
|
all_count: allCount,
|
|
} = {}
|
|
) {
|
|
$state.mineCount = mineCount;
|
|
$state.allCount = allCount;
|
|
$state.unAssignedCount = unAssignedCount;
|
|
},
|
|
};
|
|
|
|
export default {
|
|
namespaced: true,
|
|
state,
|
|
getters,
|
|
actions,
|
|
mutations,
|
|
};
|