- public sharing refactored part 1

This commit is contained in:
Peter Papp
2021-03-19 07:27:15 +01:00
parent 816c8c3e07
commit db9900fcfb
27 changed files with 563 additions and 435 deletions

View File

@@ -42,7 +42,7 @@
},
data() {
return {
password: undefined,
password: 'secret',
isLoading: false,
}
},
@@ -61,9 +61,18 @@
axios
.post('/api/browse/authenticate/' + this.$route.params.token, {
password: this.password
}).then(() => {
})
.then(response => {
// todo: Redirect to file browser page
// Show file browser
if (response.data.data.attributes.type === 'folder' && this.$router.currentRoute.name !== 'SharedFileBrowser') {
this.$router.push({name: 'SharedFileBrowser'})
}
// Show single file
if (response.data.data.attributes.type !== 'folder' && this.$router.currentRoute.name !== 'SharedSingleFile') {
this.$router.push({name: 'SharedSingleFile'})
}
})
.catch(error => {