Allow user to download a previously uploaded pdf

This commit is contained in:
richard-dds
2019-08-29 15:46:30 -04:00
parent 922a48f76a
commit b26cd3ffae
6 changed files with 32 additions and 20 deletions

View File

@@ -17,8 +17,11 @@ export default {
props: {
name: String,
initialData: {
type: Object,
filename: {
type: String,
},
objectName: {
type: String,
},
initialErrors: {
type: Boolean,
@@ -38,8 +41,8 @@ export default {
data: function() {
return {
hasInitialData: !!this.initialData,
attachment: this.initialData.filename || null,
hasInitialData: false,
attachment: this.filename || null,
changed: false,
uploadError: false,
sizeError: false,
@@ -54,9 +57,12 @@ export default {
valid: this.hasAttachment,
})
this.hasInitialData = !!this.filename
if (this.hasInitialData) {
const { filename, objectName } = this.initialData
this.downloadLink = await this.getDownloadLink(filename, objectName)
this.downloadLink = await this.getDownloadLink(
this.filename,
this.objectName
)
}
},