Merge pull request #369 from YunoHost/fix-array-args

[fix] Request with array args
This commit is contained in:
Alexandre Aubin 2021-06-03 00:42:56 +02:00 committed by GitHub
commit 711c8e8596
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 8 deletions

View file

@ -155,12 +155,12 @@ export default {
},
createBackup () {
const data = { apps: [], system: [] }
const data = { 'apps[]': [], 'system[]': [] }
for (const item of this.selected) {
if (item in this.system) {
data.system = [...data.system, ...this.system[item].value]
data['system[]'] = [...data['system[]'], ...this.system[item].value]
} else {
data.apps.push(item)
data['apps[]'].push(item)
}
}

View file

@ -201,12 +201,12 @@ export default {
)
if (!confirmed) return
const data = { apps: [], system: [], force: '' }
const data = { 'apps[]': [], 'system[]': [], force: '' }
for (const item of this.selected) {
if (item in this.system) {
data.system = [...data.system, ...this.system[item].value]
data['system[]'] = [...data['system[]'], ...this.system[item].value]
} else {
data.apps.push(item)
data['apps[]'].push(item)
}
}

View file

@ -121,7 +121,7 @@ export default {
}
// Check that every migration's disclaimer has been checked.
if (Object.values(this.checked).every(value => value === true)) {
api.post('migrations/run?accept_disclaimer', 'migrations.run').then(() => {
api.put('migrations/run?accept_disclaimer', 'migrations.run').then(() => {
this.$refs.view.fetchQueries()
})
}
@ -130,7 +130,7 @@ export default {
async skipMigration (id) {
const confirmed = await this.$askConfirmation(this.$i18n.t('confirm_migrations_skip'))
if (!confirmed) return
api.post('/migrations/run', { skip: '', targets: id }, 'migration.skip').then(() => {
api.put('/migrations/run', { skip: '', targets: id }, 'migration.skip').then(() => {
this.$refs.view.fetchQueries()
})
}