From c05a79cf614abe7d3f8f210b39529c4b3ebd165b Mon Sep 17 00:00:00 2001 From: Muhsin Keloth Date: Tue, 16 Apr 2024 09:00:52 +0530 Subject: [PATCH] fix: Add more filters for SLA download reports (#9231) Co-authored-by: iamsivin --- app/javascript/dashboard/api/slaReports.js | 2 ++ app/javascript/dashboard/api/specs/slaReports.spec.js | 2 ++ .../routes/dashboard/settings/reports/SLAReports.vue | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/javascript/dashboard/api/slaReports.js b/app/javascript/dashboard/api/slaReports.js index 36a3a895c..fedc988b2 100644 --- a/app/javascript/dashboard/api/slaReports.js +++ b/app/javascript/dashboard/api/slaReports.js @@ -37,6 +37,7 @@ class SLAReportsAPI extends ApiClient { inbox_id, team_id, sla_policy_id, + label_list, } = {}) { return axios.get(`${this.url}/download`, { params: { @@ -45,6 +46,7 @@ class SLAReportsAPI extends ApiClient { assigned_agent_id, inbox_id, team_id, + label_list, sla_policy_id, }, }); diff --git a/app/javascript/dashboard/api/specs/slaReports.spec.js b/app/javascript/dashboard/api/specs/slaReports.spec.js index e69f527b2..f540b6acc 100644 --- a/app/javascript/dashboard/api/specs/slaReports.spec.js +++ b/app/javascript/dashboard/api/specs/slaReports.spec.js @@ -83,6 +83,7 @@ describe('#SLAReports API', () => { inbox_id: 1, team_id: 1, sla_policy_id: 1, + label_list: ['label1'], }); expect(axiosMock.get).toHaveBeenCalledWith( '/api/v1/applied_slas/download', @@ -94,6 +95,7 @@ describe('#SLAReports API', () => { inbox_id: 1, team_id: 1, sla_policy_id: 1, + label_list: ['label1'], }, } ); diff --git a/app/javascript/dashboard/routes/dashboard/settings/reports/SLAReports.vue b/app/javascript/dashboard/routes/dashboard/settings/reports/SLAReports.vue index 3c12a4527..a9958d905 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/reports/SLAReports.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/reports/SLAReports.vue @@ -94,8 +94,8 @@ export default { const type = 'sla'; try { this.$store.dispatch('slaReports/download', { - fileName: generateFileName({ type, to: this.to }), - ...this.requestPayload, + fileName: generateFileName({ type, to: this.activeFilter.to }), + ...this.activeFilter, }); } catch (error) { this.showAlert(this.$t('SLA_REPORTS.DOWNLOAD_FAILED'));