update backups api routes

This commit is contained in:
axolotle 2021-03-22 17:00:13 +01:00
parent 89086a8003
commit 06eb2165ea
3 changed files with 6 additions and 6 deletions

View file

@ -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 } }) this.$router.push({ name: 'backup-list', params: { id: this.id } })
}) })
} }

View file

@ -132,7 +132,7 @@ export default {
data () { data () {
return { return {
queries: [ queries: [
['GET', `backup/archives/${this.name}?with_details`] ['GET', `backups/${this.name}?with_details`]
], ],
selected: [], selected: [],
error: '', 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 this.isValid = null
}).catch(err => { }).catch(err => {
if (err.name !== 'APIBadRequestError') throw 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 })) const confirmed = await this.$askConfirmation(this.$i18n.t('confirm_delete', { name: this.name }))
if (!confirmed) return 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 } }) this.$router.push({ name: 'backup-list', params: { id: this.id } })
}) })
}, },
downloadBackup () { downloadBackup () {
const host = this.$store.getters.host 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')
} }
}, },

View file

@ -45,7 +45,7 @@ export default {
data () { data () {
return { return {
queries: [ queries: [
['GET', 'backup/archives?with_info'] ['GET', 'backups?with_info']
], ],
archives: undefined archives: undefined
} }