From d5e0fa39aaaaea33f385e5b873a1ce266bc93271 Mon Sep 17 00:00:00 2001 From: Andre Pestana <78114138+andrepestana-aot@users.noreply.github.com> Date: Thu, 31 Oct 2024 14:11:09 -0700 Subject: [PATCH] #3840 - Hotfix: Fix for withdraw upload (#3868) Same fix done for the bulk upload in https://github.com/bcgov/SIMS/pull/3860. --- .../web/src/views/institution/WithdrawalUpload.vue | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/sources/packages/web/src/views/institution/WithdrawalUpload.vue b/sources/packages/web/src/views/institution/WithdrawalUpload.vue index 24026f57c7..7318b5b3cd 100644 --- a/sources/packages/web/src/views/institution/WithdrawalUpload.vue +++ b/sources/packages/web/src/views/institution/WithdrawalUpload.vue @@ -55,7 +55,7 @@ :clearable="true" :accept="ACCEPTED_FILE_TYPE" density="compact" - v-model="withdrawalFiles" + v-model="withdrawalFile" label="Withdrawal text file" variant="outlined" prepend-icon="fa:fa-solid fa-file-text" @@ -181,8 +181,8 @@ export default defineComponent({ const validationProcessing = ref(false); const creationProcessing = ref(false); const { dateOnlyLongString, numberEmptyFiller } = useFormatters(); - // Only one will be used but the component allows multiple. - const withdrawalFiles = ref([]); + // If multiple prop is undefined or false for VFileInput the component returns now a File object. + const withdrawalFile = ref(); // Possible errors and warnings received upon file upload. const validationResults = ref([] as ApplicationBulkWithdrawal[]); const uploadForm = ref({} as VForm); @@ -210,10 +210,9 @@ export default defineComponent({ } else { creationProcessing.value = true; } - const [fileToUpload] = withdrawalFiles.value; const uploadResults = await ScholasticStandingService.shared.applicationBulkWithdrawal( - fileToUpload, + withdrawalFile.value as Blob, validationOnly, (progressEvent: AxiosProgressEvent) => { uploadProgress.value = progressEvent; @@ -265,7 +264,7 @@ export default defineComponent({ const resetForm = () => { validationResults.value = []; - withdrawalFiles.value = []; + withdrawalFile.value = undefined; }; const loading = computed( @@ -279,7 +278,7 @@ export default defineComponent({ DEFAULT_PAGE_LIMIT, ITEMS_PER_PAGE, PAGINATION_LIST, - withdrawalFiles, + withdrawalFile, uploadFile, validationResults, fileValidationRules,