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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user