fix upload

This commit is contained in:
Pete Matsyburka
2025-12-26 12:08:29 +02:00
parent e9a39e2571
commit 369a09a6df
+4 -1
View File
@@ -216,6 +216,9 @@ export default {
queryParams () { queryParams () {
return new URLSearchParams(window.location.search) return new URLSearchParams(window.location.search)
}, },
uploadUrl () {
return `/templates/${this.templateId}/documents`
},
googleDriveOauthPath () { googleDriveOauthPath () {
const params = { const params = {
access_type: 'offline', access_type: 'offline',
@@ -279,7 +282,7 @@ export default {
async upload ({ path } = {}) { async upload ({ path } = {}) {
this.isLoading = true this.isLoading = true
return this.baseFetch(path || `/templates/${this.templateId}/documents`, { return this.baseFetch(path || this.uploadUrl, {
method: 'POST', method: 'POST',
headers: { Accept: 'application/json' }, headers: { Accept: 'application/json' },
body: new FormData(this.$refs.form) body: new FormData(this.$refs.form)