fix upload
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user