Skip to content

Commit

Permalink
Get endpoint from capabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
diocas committed Dec 21, 2021
1 parent ed9961b commit f29b87c
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions packages/web-app-files/src/components/AppBar/AppBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,14 @@ export default {
}),
computed: {
...mapGetters('External', ['mimeTypes']),
...mapGetters(['getToken', 'configuration', 'newFileHandlers', 'quota', 'user']),
...mapGetters([
'getToken',
'capabilities',
'configuration',
'newFileHandlers',
'quota',
'user'
]),
...mapGetters('Files', ['files', 'currentFolder', 'selectedFiles', 'publicLinkPassword']),
...mapState(['route']),
...mapState('Files', ['areHiddenFilesShown']),
Expand Down Expand Up @@ -539,8 +546,11 @@ export default {
async addAppProviderFile(fileName) {
try {
const parent = this.currentFolder.fileId
// TODO shouuld url be a capability?
const url = `/app/new?parent_container_id=${parent}&filename=${fileName}`
const configUrl = this.configuration.server
const appNewUrl = this.capabilities.files.app_providers[0].new_url.replace(/^\/+/, '')
const url = configUrl + appNewUrl + `?parent_container_id=${parent}&filename=${fileName}`
const headers = new Headers()
if (!this.isPublicFilesRoute) {
headers.append('Authorization', 'Bearer ' + this.getToken)
Expand Down

0 comments on commit f29b87c

Please sign in to comment.