Add checkbox to configure backup site backup for update behavior

This commit is contained in:
Johannes Zellner
2025-09-24 17:22:10 +02:00
parent 073ece0527
commit 0d3450ceed
13 changed files with 25 additions and 19 deletions
+4 -4
View File
@@ -20,8 +20,8 @@ function create() {
if (error || result.status !== 200) return [error || result];
return [null, result.body.backupSites];
},
async add(name, format, contents, provider, config, schedule, retention, limits = null) {
const data = { name, format, contents, provider, config, schedule, retention };
async add(name, format, contents, enableForUpdates, provider, config, schedule, retention, limits = null) {
const data = { name, format, contents, enableForUpdates, provider, config, schedule, retention };
if (limits !== null) data.limits = limits;
@@ -69,10 +69,10 @@ function create() {
if (error || result.status !== 202) return [error || result];
return [null, result.body.taskId];
},
async setPrimary(id) {
async setEnableForUpdates(id, enable) {
let error, result;
try {
result = await fetcher.post(`${API_ORIGIN}/api/v1/backup_sites/${id}/configure/primary`, {}, { access_token: accessToken });
result = await fetcher.post(`${API_ORIGIN}/api/v1/backup_sites/${id}/configure/enable_for_updates`, { enable }, { access_token: accessToken });
} catch (e) {
error = e;
}