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:
João Ferreira Batista 2025-08-20 10:34:42 +02:00 committed by GitHub
parent d2a6bdb18c
commit d1da9f2f02
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -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;
} }