feat: Download SLA reports (#9201)

This commit is contained in:
Muhsin Keloth
2024-04-09 09:21:34 +05:30
committed by GitHub
parent 12c5739287
commit c4e111b554
3 changed files with 30 additions and 2 deletions

View File

@@ -1,7 +1,7 @@
import * as MutationHelpers from 'shared/helpers/vuex/mutationHelpers';
import types from '../mutation-types';
import SLAReportsAPI from '../../api/slaReports';
import { downloadCsvFile } from 'dashboard/helper/downloadHelper';
export const state = {
records: [],
metrics: {
@@ -60,6 +60,11 @@ export const actions = {
commit(types.SET_SLA_REPORTS_UI_FLAG, { isFetchingMetrics: false });
}
},
download(_, params) {
return SLAReportsAPI.download(params).then(response => {
downloadCsvFile(params.fileName, response.data);
});
},
};
export const mutations = {