mirror of
https://github.com/Sebclem/hassio-nextcloud-backup.git
synced 2024-11-26 19:06:55 +01:00
31 lines
634 B
TypeScript
31 lines
634 B
TypeScript
import type { WebdavBackup } from "@/types/webdav";
|
|
import kyClient from "./kyClient";
|
|
|
|
export function getAutoBackupList() {
|
|
return kyClient.get("webdav/backup/auto").json<WebdavBackup[]>();
|
|
}
|
|
|
|
export function getManualBackupList() {
|
|
return kyClient.get("webdav/backup/manual").json<WebdavBackup[]>();
|
|
}
|
|
|
|
export function deleteWebdabBackup(path: string) {
|
|
return kyClient
|
|
.delete("webdav", {
|
|
json: {
|
|
path: path,
|
|
},
|
|
})
|
|
.text();
|
|
}
|
|
|
|
export function restoreWebdavBackup(path: string) {
|
|
return kyClient
|
|
.post("webdav/restore", {
|
|
json: {
|
|
path: path,
|
|
},
|
|
})
|
|
.text();
|
|
}
|