- 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
@@ -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>