From d588a9bb4710311c511226c05a6ce810c59a671d Mon Sep 17 00:00:00 2001 From: Trevor Richards Date: Wed, 4 Sep 2024 16:39:19 -0700 Subject: [PATCH] fix: breaking vuetify changes to file upload --- frontend/src/components/DocumentUpload.vue | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/frontend/src/components/DocumentUpload.vue b/frontend/src/components/DocumentUpload.vue index 1c5871d..c222d04 100644 --- a/frontend/src/components/DocumentUpload.vue +++ b/frontend/src/components/DocumentUpload.vue @@ -16,7 +16,7 @@ label="Document Type" /> @@ -170,13 +170,12 @@ export default { submitRequest() { if (this.dataReady) { try { - const [ file ] = this.fileArray; this.active = true; const reader = new FileReader(); reader.onload = this.uploadFile; reader.onabort = this.handleFileReadErr; reader.onerror = this.handleFileReadErr; - reader.readAsBinaryString(file); + reader.readAsBinaryString(this.inputFile); } catch (e) { this.handleFileReadErr(); throw e; @@ -188,12 +187,11 @@ export default { this.setErrorAlert('Sorry, an unexpected error seems to have occurred. Try uploading your files later.'); }, async uploadFile(env) { - const [ file ] = this.fileArray; let document = { documentTypeCode: this.documentTypeCode, - fileName: getFileNameWithMaxNameLength(file.name), - fileExtension: file.type, - fileSize: file.size, + fileName: getFileNameWithMaxNameLength(this.inputFile.name), + fileExtension: this.inputFile.type, + fileSize: this.inputFile.size, documentData: btoa(env.target.result) };