This commit is contained in:
2021-09-08 15:11:38 +00:00
parent f14ff02452
commit f24bc9f716
4 changed files with 50 additions and 94 deletions

View File

@@ -177,33 +177,20 @@ export default {
return;
}
try {
//Does the database need to be erased?
let res = await window.$gz.api.get("license/database-empty");
//We never expect there to be no data here
if (!res.hasOwnProperty("data")) {
return Promise.reject(res);
let dialogResult = await window.$gz.dialog.confirmGeneric(
"AdminEraseDatabaseWarning",
"warning"
);
if (dialogResult == false) {
return;
}
if (res.data != true) {
let dialogResult = await window.$gz.dialog.confirmGeneric(
"AdminEraseDatabaseWarning",
"warning"
);
if (dialogResult == false) {
return;
}
dialogResult = await window.$gz.dialog.confirmGeneric(
"AdminEraseDatabaseLastWarning",
"error"
);
if (dialogResult == false) {
return;
}
//call erase
await window.$gz.api.upsert(
"license/permanently-erase-all-data",
"I understand"
);
dialogResult = await window.$gz.dialog.confirmGeneric(
"AdminEraseDatabaseLastWarning",
"error"
);
if (dialogResult == false) {
return;
}
//call seed route