From 718390526400e045d8471019bd44f2e6e6e69dc1 Mon Sep 17 00:00:00 2001 From: tomlovesgithub <44227249+tomlovesgithub@users.noreply.github.com> Date: Mon, 2 Dec 2024 10:52:40 +0000 Subject: [PATCH] Bugfix/ts 483 eligibility annex report (#2629) * fix report * jac-kit * remove unused import --------- Co-authored-by: halcyonjac --- .../Exercise/Reports/EligibilityIssuesV2.vue | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/views/Exercise/Reports/EligibilityIssuesV2.vue b/src/views/Exercise/Reports/EligibilityIssuesV2.vue index 7499831a1..d2684dad4 100644 --- a/src/views/Exercise/Reports/EligibilityIssuesV2.vue +++ b/src/views/Exercise/Reports/EligibilityIssuesV2.vue @@ -240,7 +240,7 @@ import vuexfireSerialize from '@jac-uk/jac-kit/helpers/vuexfireSerialize'; import Table from '@jac-uk/jac-kit/components/Table/Table.vue'; import TableCell from '@jac-uk/jac-kit/components/Table/TableCell.vue'; import { tableAsyncQuery } from '@jac-uk/jac-kit/components/Table/tableQuery'; -import { downloadXLSX } from '@jac-uk/jac-kit/helpers/export'; +// import { downloadXLSX } from '@jac-uk/jac-kit/helpers/export'; import permissionMixin from '@/permissionMixin'; import Select from '@jac-uk/jac-kit/draftComponents/Form/Select.vue'; import TextareaInput from '@jac-uk/jac-kit/draftComponents/Form/TextareaInput.vue'; @@ -368,16 +368,12 @@ export default { }, async exportData() { try { - const title = 'Eligibility Annex'; - const xlsxData = await this.gatherReportData(); - - downloadXLSX( - xlsxData, - { - title: `${this.exercise.referenceNumber} ${title}`, - sheetName: title, - fileName: `${this.exercise.referenceNumber} - ${title}.xlsx`, - } + const result = await httpsCallable(functions, 'exportApplicationEligibilityIssues')({ exerciseId: this.exercise.id, format: 'annex', status: this.filterStatus === 'all' ? null : this.filterStatus }); + if (!result.data) return; + downloadBase64File( + 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', + result.data, + `${this.exercise.referenceNumber}_Eligibility Annex Report.docx` ); return true; } catch (error) {