- ability leave team folder

- refactoring
This commit is contained in:
Čarodej
2021-10-26 09:05:08 +02:00
parent 6ef50978d5
commit 15e154176d
17 changed files with 235 additions and 58 deletions
+13 -2
View File
@@ -301,7 +301,7 @@
this.$store.commit('SET_AUTHORIZED', true)
// Go to files page
this.$router.push({name: 'Files'})
this.proceedToAccount()
}
})
.catch(error => {
@@ -336,7 +336,7 @@
this.$store.commit('SET_AUTHORIZED', true)
// Go to files page
this.$router.push({name: 'Files'})
this.proceedToAccount()
})
.catch(error => {
@@ -368,6 +368,13 @@
}
},
proceedToAccount() {
if (this.$route.query.redirect) {
this.$router.push(this.$route.query.redirect)
} else {
this.$router.push({name: 'Files'})
}
}
},
created() {
this.$scrollTop()
@@ -377,6 +384,10 @@
this.loginEmail = 'howdy@hi5ve.digital'
this.loginPassword = 'vuefilemanager'
//}
console.log(
);
}
}
</script>
@@ -191,6 +191,22 @@
events.$on('context-menu:show', (event, item) => this.item = item)
events.$on('mobile-context-menu:show', item => this.item = item)
events.$on('context-menu:current-folder', folder => this.item = folder)
events.$on('action:confirmed', data => {
// Leave team folder after popup confirmation
if (data.operation === 'leave-team-folder')
axios.delete(`/api/teams/folders/${data.id}/leave`)
.then(() => {
this.$router.push({name: 'SharedWithMe'})
events.$emit('toaster', {
type: 'success',
message: this.$t('You have successfully left the team folder'),
})
})
.catch(() => this.$isSomethingWrong())
})
}
}
</script>