Skip to content

Commit

Permalink
Merge pull request #6449 from cernbox/app_p_new
Browse files Browse the repository at this point in the history
Fix file creation
  • Loading branch information
kulmann authored Feb 17, 2022
2 parents 22c5176 + 45c8a7e commit 0294044
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions packages/web-app-files/src/components/AppBar/AppBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ export default {
resource = await this.$client.publicFiles.getFileInfo(
path,
this.publicLinkPassword,
DavProperties.Default
DavProperties.PublicLink
)
}
resource = buildResource(resource)
Expand Down Expand Up @@ -521,6 +521,13 @@ export default {
path = buildWebDavSpacesPath(this.$route.params.spaceId, path)
await this.$client.files.putFileContents(path, '')
resource = await this.$client.files.fileInfo(path, DavProperties.Default)
} else {
await this.$client.publicFiles.putFileContents('', path, this.publicLinkPassword, '')
resource = await this.$client.publicFiles.getFileInfo(
path,
this.publicLinkPassword,
DavProperties.PublicLink
)
}
if (this.newFileAction) {
Expand Down Expand Up @@ -601,9 +608,14 @@ export default {
throw new Error(`An error has occurred: ${response.status}`)
}
const path = pathUtil.join(this.currentPath, fileName)
let resource
let path = pathUtil.join(this.currentPath, fileName)
if (this.isPersonalLocation) {
path = buildWebDavFilesPath(this.user.id, path)
resource = await this.$client.files.fileInfo(path, DavProperties.Default)
} else if (this.isSpacesProjectLocation) {
path = buildWebDavSpacesPath(this.$route.params.spaceId, path)
resource = await this.$client.files.fileInfo(path, DavProperties.Default)
} else {
resource = await this.$client.publicFiles.getFileInfo(
Expand Down Expand Up @@ -687,7 +699,7 @@ export default {
resource = await this.$client.publicFiles.getFileInfo(
path,
this.publicLinkPassword,
DavProperties.Default
DavProperties.PublicLink
)
}
Expand Down

0 comments on commit 0294044

Please sign in to comment.