Require portfolio id in upload-token

It's necessary for the authz decorator
This commit is contained in:
richard-dds
2019-08-28 11:59:11 -04:00
parent 0566b525f6
commit 67a4bb602d
5 changed files with 28 additions and 15 deletions

View File

@@ -34,6 +34,9 @@ export default {
type: Boolean,
default: true,
},
portfolioId: {
type: String,
},
},
data: function() {
@@ -104,7 +107,9 @@ export default {
this.sizeError = false
},
getUploader: async function() {
return fetch('/upload-token', { credentials: 'include' })
return fetch(`/task_orders/${this.portfolioId}/upload-token`, {
credentials: 'include',
})
.then(response => response.json())
.then(({ token, objectName }) => buildUploader(token, objectName))
},