1
0
mirror of https://github.com/home-assistant/frontend.git synced 2026-04-17 23:54:28 +01:00

Use backend logic for partial backup while updating (#11364)

This commit is contained in:
Joakim Sørensen
2022-01-20 19:12:52 +01:00
committed by GitHub
parent 930c7e4afa
commit 7ad0b37a9e
4 changed files with 26 additions and 50 deletions

View File

@@ -302,7 +302,8 @@ export const installHassioAddon = async (
export const updateHassioAddon = async (
hass: HomeAssistant,
slug: string
slug: string,
backup: boolean
): Promise<void> => {
if (atLeastVersion(hass.config.version, 2021, 2, 4)) {
await hass.callWS({
@@ -310,11 +311,13 @@ export const updateHassioAddon = async (
endpoint: `/store/addons/${slug}/update`,
method: "post",
timeout: null,
data: { backup },
});
} else {
await hass.callApi<HassioResponse<void>>(
"POST",
`hassio/addons/${slug}/update`
`hassio/addons/${slug}/update`,
{ backup }
);
}
};