fix: Add more filters for SLA download reports (#9231)

Co-authored-by: iamsivin <iamsivin@gmail.com>
This commit is contained in:
Muhsin Keloth
2024-04-16 09:00:52 +05:30
committed by GitHub
parent f71f43e54a
commit c05a79cf61
3 changed files with 6 additions and 2 deletions

View File

@@ -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,
},
});

View File

@@ -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'],
},
}
);

View File

@@ -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'));