From 2cf82c8dcb56f47511e0968dc8d4ac40c38deacc Mon Sep 17 00:00:00 2001 From: "theis.gaedigk" Date: Wed, 20 Aug 2025 18:09:33 +0200 Subject: [PATCH] fixed bug: error handeling --- frontend/src/utils/fetchData.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/utils/fetchData.ts b/frontend/src/utils/fetchData.ts index 72f1da7..2c8abbe 100644 --- a/frontend/src/utils/fetchData.ts +++ b/frontend/src/utils/fetchData.ts @@ -32,7 +32,7 @@ export const fetchAllData = async (token: string | undefined) => { }, }); - if (response.status === 401) { + if (response.status === 500) { if (!sendError) { sendError = true; myToast("Session expired. Please log in again.", "error"); @@ -64,7 +64,7 @@ export const fetchAllData = async (token: string | undefined) => { }, }); - if (response.status === 401) { + if (response.status === 500) { if (!sendError) { sendError = true; myToast("Session expired. Please log in again.", "error"); @@ -96,7 +96,7 @@ export const fetchAllData = async (token: string | undefined) => { }, }); - if (response.status === 401) { + if (response.status === 500) { if (!sendError) { sendError = true; myToast("Session expired. Please log in again.", "error"); @@ -168,7 +168,7 @@ export const getBorrowableItems = async () => { body: JSON.stringify({ startDate, endDate }), }); - if (response.status === 401) { + if (response.status === 500) { if (!sendError) { sendError = true; myToast("Session expired. Please log in again.", "error");