From c4ae08f558a3cf8aae291b08286765800d14758f Mon Sep 17 00:00:00 2001 From: Tudor Stanciu Date: Tue, 18 Jan 2022 14:26:36 +0200 Subject: [PATCH] useApi fix --- src/api/useApi.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/useApi.js b/src/api/useApi.js index bd25d57..15eaf68 100644 --- a/src/api/useApi.js +++ b/src/api/useApi.js @@ -9,7 +9,7 @@ const useApi = () => { const handleError = err => { let message; - switch (err.response.status) { + switch (err.response?.status) { case 500: message = err.response.statusText; break;