Fixes error message presented in the settins scheduling frontend (#1035)
When you submit an incorrect cron (for example ``0 5``) the frontend doesn't surface the error message that the API returns, but only the default generic one. This fix makes it surface when the api returns the message in the error attribute and not in the message attribute.
This commit is contained in:
parent
d2a6bdb18c
commit
d1da9f2f02
|
|
@ -49,7 +49,7 @@ const APIClient = async <T>(
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
throw {
|
throw {
|
||||||
status: response.status,
|
status: response.status,
|
||||||
message: data?.message || 'An error occurred while processing the request.',
|
message: data?.message || data?.error || 'An error occurred while processing the request.',
|
||||||
} as ApiError;
|
} as ApiError;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue