Fix webUI success / error messages (#7820)

* Fix export error handling

* Ensure that config editor success / error is updated each time

* Set response

* Formatting
This commit is contained in:
Nicolas Mowen
2023-09-16 04:59:50 -05:00
committed by GitHub
parent 9185753322
commit b9e6afa659
3 changed files with 10 additions and 2 deletions
+3
View File
@@ -28,10 +28,13 @@ export default function Config() {
})
.then((response) => {
if (response.status === 200) {
setError('');
setSuccess(response.data);
}
})
.catch((error) => {
setSuccess('');
if (error.response) {
setError(error.response.data.message);
} else {
+1 -1
View File
@@ -58,7 +58,7 @@ export default function Export() {
}
})
.catch((error) => {
if (error.response) {
if (error.response?.data?.message) {
setMessage({ text: `Failed to start export: ${error.response.data.message}`, error: true });
} else {
setMessage({ text: `Failed to start export: ${error.message}`, error: true });