chore: Add an option to download CSAT Reports (#4694)
This commit is contained in:
@@ -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 = {
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user