mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Await backup restore (#13167)
This commit is contained in:
parent
da709cbbd1
commit
cd4f6e19f4
@ -201,26 +201,24 @@ class HassioBackupDialog
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!this._dialogParams?.onboarding) {
|
if (!this._dialogParams?.onboarding) {
|
||||||
this.hass!.callApi(
|
try {
|
||||||
"POST",
|
await this.hass!.callApi(
|
||||||
|
"POST",
|
||||||
|
|
||||||
`hassio/${
|
`hassio/${
|
||||||
atLeastVersion(this.hass!.config.version, 2021, 9)
|
atLeastVersion(this.hass!.config.version, 2021, 9)
|
||||||
? "backups"
|
? "backups"
|
||||||
: "snapshots"
|
: "snapshots"
|
||||||
}/${this._backup!.slug}/restore/partial`,
|
}/${this._backup!.slug}/restore/partial`,
|
||||||
backupDetails
|
backupDetails
|
||||||
).then(
|
);
|
||||||
() => {
|
this.closeDialog();
|
||||||
this.closeDialog();
|
} catch (error: any) {
|
||||||
},
|
this._error = error.body.message;
|
||||||
(error) => {
|
}
|
||||||
this._error = error.body.message;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
fireEvent(this, "restoring");
|
fireEvent(this, "restoring");
|
||||||
fetch(`/api/hassio/backups/${this._backup!.slug}/restore/partial`, {
|
await fetch(`/api/hassio/backups/${this._backup!.slug}/restore/partial`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify(backupDetails),
|
body: JSON.stringify(backupDetails),
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user