fix: admin users were created while the setup wizard wasn't finished

This commit is contained in:
Elias Schneider
2023-01-26 15:43:13 +01:00
parent 7e91038a24
commit ad92cfc852
8 changed files with 37 additions and 22 deletions

View File

@@ -112,15 +112,7 @@ const AdminConfigTable = () => {
<Group position="right">
<Button
onClick={() => {
if (config.get("SETUP_FINISHED")) {
configService
.updateMany(updatedConfigVariables)
.then(() => {
updatedConfigVariables = [];
toast.success("Configurations updated successfully");
})
.catch(toast.axiosError);
} else {
if (config.get("SETUP_STATUS") == "REGISTERED") {
configService
.updateMany(updatedConfigVariables)
.then(async () => {
@@ -128,6 +120,14 @@ const AdminConfigTable = () => {
window.location.reload();
})
.catch(toast.axiosError);
} else {
configService
.updateMany(updatedConfigVariables)
.then(() => {
updatedConfigVariables = [];
toast.success("Configurations updated successfully");
})
.catch(toast.axiosError);
}
}}
>