chore: Add an option to download CSAT Reports (#4694)

This commit is contained in:
Pranav Raj S
2022-05-17 21:01:45 +05:30
committed by GitHub
parent 361ffbab82
commit 47f04ee3fe
16 changed files with 189 additions and 28 deletions

View File

@@ -1,6 +1,7 @@
import * as MutationHelpers from 'shared/helpers/vuex/mutationHelpers';
import types from '../mutation-types';
import CSATReports from '../../api/csatReports';
import { downloadCsvFile } from '../../helper/downloadHelper';
const computeDistribution = (value, total) =>
((value * 100) / total).toFixed(2);
@@ -107,6 +108,11 @@ export const actions = {
commit(types.SET_CSAT_RESPONSE_UI_FLAG, { isFetchingMetrics: false });
}
},
downloadCSATReports(_, params) {
return CSATReports.download(params).then(response => {
downloadCsvFile(params.fileName, response.data);
});
},
};
export const mutations = {

View File

@@ -5,7 +5,7 @@ import * as types from '../mutation-types';
import Report from '../../api/reports';
import Vue from 'vue';
import { downloadCsvFile } from '../../helper/downloadCsvFile';
import { downloadCsvFile } from '../../helper/downloadHelper';
const state = {
fetchingStatus: false,