fixed bug: error handeling
This commit is contained in:
@@ -32,7 +32,7 @@ export const fetchAllData = async (token: string | undefined) => {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (response.status === 401) {
|
if (response.status === 500) {
|
||||||
if (!sendError) {
|
if (!sendError) {
|
||||||
sendError = true;
|
sendError = true;
|
||||||
myToast("Session expired. Please log in again.", "error");
|
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) {
|
if (!sendError) {
|
||||||
sendError = true;
|
sendError = true;
|
||||||
myToast("Session expired. Please log in again.", "error");
|
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) {
|
if (!sendError) {
|
||||||
sendError = true;
|
sendError = true;
|
||||||
myToast("Session expired. Please log in again.", "error");
|
myToast("Session expired. Please log in again.", "error");
|
||||||
@@ -168,7 +168,7 @@ export const getBorrowableItems = async () => {
|
|||||||
body: JSON.stringify({ startDate, endDate }),
|
body: JSON.stringify({ startDate, endDate }),
|
||||||
});
|
});
|
||||||
|
|
||||||
if (response.status === 401) {
|
if (response.status === 500) {
|
||||||
if (!sendError) {
|
if (!sendError) {
|
||||||
sendError = true;
|
sendError = true;
|
||||||
myToast("Session expired. Please log in again.", "error");
|
myToast("Session expired. Please log in again.", "error");
|
||||||
|
Reference in New Issue
Block a user