fix(webapp): handle the too many requests error

This commit is contained in:
Ahmed Bouhuolia
2023-07-16 21:19:06 +02:00
parent 92f929152f
commit 8b0feb9022
5 changed files with 26 additions and 3 deletions

View File

@@ -60,6 +60,9 @@ export default function useApiRequest() {
if (status === 403) {
setGlobalErrors({ access_denied: true });
}
if (status === 429) {
setGlobalErrors({ too_many_requests: true });
}
if (status === 400) {
const lockedError = data.errors.find(
(error) => error.type === 'TRANSACTIONS_DATE_LOCKED',