mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-03-22 00:17:13 +01:00
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:
parent
9185753322
commit
b9e6afa659
@ -1646,7 +1646,12 @@ def export_recording(camera_name: str, start_time, end_time):
|
||||
)
|
||||
|
||||
if recordings_count <= 0:
|
||||
return "No recordings found for time range", 400
|
||||
return make_response(
|
||||
jsonify(
|
||||
{"success": False, "message": "No recordings found for time range"}
|
||||
),
|
||||
400,
|
||||
)
|
||||
|
||||
exporter = RecordingExporter(
|
||||
current_app.frigate_config,
|
||||
|
@ -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 {
|
||||
|
@ -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 });
|
||||
|
Loading…
Reference in New Issue
Block a user