fix: Update the relevant agent presence only (#5220)

This commit is contained in:
Pranav Raj S
2022-08-09 12:32:09 +05:30
committed by GitHub
parent cbcee6414c
commit 657bd44418
11 changed files with 100 additions and 62 deletions

View File

@@ -1,10 +1,6 @@
/* eslint no-console: 0 */
/* eslint no-param-reassign: 0 */
/* eslint no-shadow: 0 */
import * as types from '../mutation-types';
import Report from '../../api/reports';
import Vue from 'vue';
import { downloadCsvFile } from '../../helper/downloadHelper';
const state = {
@@ -116,9 +112,6 @@ export const actions = {
commit(types.default.TOGGLE_AGENT_CONVERSATION_METRIC_LOADING, false);
});
},
updateReportAgentStatus({ commit }, data) {
commit(types.default.UPDATE_REPORT_AGENTS_STATUS, data);
},
downloadAgentReports(_, reportObj) {
return Report.getAgentReports(reportObj)
.then(response => {
@@ -179,16 +172,6 @@ const mutations = {
[types.default.TOGGLE_AGENT_CONVERSATION_METRIC_LOADING](_state, flag) {
_state.overview.uiFlags.isFetchingAgentConversationMetric = flag;
},
[types.default.UPDATE_REPORT_AGENTS_STATUS](_state, data) {
_state.overview.agentConversationMetric.forEach((element, index) => {
const availabilityStatus = data[element.id];
Vue.set(
_state.overview.agentConversationMetric[index],
'availability',
availabilityStatus || 'offline'
);
});
},
};
export default {