mirror of
https://github.com/Sebclem/hassio-nextcloud-backup.git
synced 2024-11-22 09:12:58 +01:00
Create backup folder on setting save
This commit is contained in:
parent
cd4032cd6f
commit
8b1285780b
@ -9,7 +9,10 @@ import {
|
|||||||
saveWebdavConfig,
|
saveWebdavConfig,
|
||||||
validateWebdavConfig,
|
validateWebdavConfig,
|
||||||
} from "../services/webdavConfigService.js";
|
} from "../services/webdavConfigService.js";
|
||||||
import { checkWebdavLogin } from "../services/webdavService.js";
|
import {
|
||||||
|
checkWebdavLogin,
|
||||||
|
createBackupFolder,
|
||||||
|
} from "../services/webdavService.js";
|
||||||
import type { BackupConfig } from "../types/services/backupConfig.js";
|
import type { BackupConfig } from "../types/services/backupConfig.js";
|
||||||
import type { ValidationError } from "joi";
|
import type { ValidationError } from "joi";
|
||||||
import type { WebdavConfig } from "../types/services/webdavConfig.js";
|
import type { WebdavConfig } from "../types/services/webdavConfig.js";
|
||||||
@ -46,6 +49,9 @@ configRouter.put("/webdav", (req, res) => {
|
|||||||
.then(() => {
|
.then(() => {
|
||||||
return checkWebdavLogin(req.body as WebdavConfig, true);
|
return checkWebdavLogin(req.body as WebdavConfig, true);
|
||||||
})
|
})
|
||||||
|
.then(() => {
|
||||||
|
return createBackupFolder(req.body as WebdavConfig);
|
||||||
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
saveWebdavConfig(req.body as WebdavConfig);
|
saveWebdavConfig(req.body as WebdavConfig);
|
||||||
res.status(204).send();
|
res.status(204).send();
|
||||||
|
Loading…
Reference in New Issue
Block a user