1
0
mirror of https://github.com/home-assistant/frontend.git synced 2026-04-20 00:40:21 +01:00

Add selection to snapshot table for mass deletion (#9284)

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
This commit is contained in:
Joakim Sørensen
2021-05-28 15:49:40 +02:00
committed by GitHub
parent 959134df02
commit 2d5ae78521
3 changed files with 154 additions and 5 deletions

View File

@@ -130,6 +130,21 @@ export const createHassioFullSnapshot = async (
);
};
export const removeSnapshot = async (hass: HomeAssistant, slug: string) => {
if (atLeastVersion(hass.config.version, 2021, 2, 4)) {
await hass.callWS({
type: "supervisor/api",
endpoint: `/snapshots/${slug}/remove`,
method: "post",
});
return;
}
await hass.callApi<HassioResponse<void>>(
"POST",
`hassio/snapshots/${slug}/remove`
);
};
export const createHassioPartialSnapshot = async (
hass: HomeAssistant,
data: HassioPartialSnapshotCreateParams