From 06eb2165eab3b9afe27b6a1f9ff476f4afaa6ffc Mon Sep 17 00:00:00 2001 From: axolotle Date: Mon, 22 Mar 2021 17:00:13 +0100 Subject: [PATCH] update backups api routes --- app/src/views/backup/BackupCreate.vue | 2 +- app/src/views/backup/BackupInfo.vue | 8 ++++---- app/src/views/backup/BackupList.vue | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/views/backup/BackupCreate.vue b/app/src/views/backup/BackupCreate.vue index 7d3dd5d3..1088bc83 100644 --- a/app/src/views/backup/BackupCreate.vue +++ b/app/src/views/backup/BackupCreate.vue @@ -164,7 +164,7 @@ export default { } } - api.post('backup', data).then(response => { + api.post('backups', data).then(response => { this.$router.push({ name: 'backup-list', params: { id: this.id } }) }) } diff --git a/app/src/views/backup/BackupInfo.vue b/app/src/views/backup/BackupInfo.vue index 3529e69d..c472357d 100644 --- a/app/src/views/backup/BackupInfo.vue +++ b/app/src/views/backup/BackupInfo.vue @@ -132,7 +132,7 @@ export default { data () { return { queries: [ - ['GET', `backup/archives/${this.name}?with_details`] + ['GET', `backups/${this.name}?with_details`] ], selected: [], error: '', @@ -210,7 +210,7 @@ export default { } } - api.post('backup/restore/' + this.name, data).then(response => { + api.put(`backups/${this.name}/restore`, data).then(response => { this.isValid = null }).catch(err => { if (err.name !== 'APIBadRequestError') throw err @@ -223,14 +223,14 @@ export default { const confirmed = await this.$askConfirmation(this.$i18n.t('confirm_delete', { name: this.name })) if (!confirmed) return - api.delete('backup/archives/' + this.name).then(() => { + api.delete('backups/' + this.name).then(() => { this.$router.push({ name: 'backup-list', params: { id: this.id } }) }) }, downloadBackup () { const host = this.$store.getters.host - window.open(`https://${host}/yunohost/api/backup/download/${this.name}`, '_blank') + window.open(`https://${host}/yunohost/api/backups/${this.name}/download`, '_blank') } }, diff --git a/app/src/views/backup/BackupList.vue b/app/src/views/backup/BackupList.vue index b15aa290..467a75a3 100644 --- a/app/src/views/backup/BackupList.vue +++ b/app/src/views/backup/BackupList.vue @@ -45,7 +45,7 @@ export default { data () { return { queries: [ - ['GET', 'backup/archives?with_info'] + ['GET', 'backups?with_info'] ], archives: undefined }