diff --git a/src/frontend/src/controllers/API/queries/flows/use-get-refresh-flows-query.ts b/src/frontend/src/controllers/API/queries/flows/use-get-refresh-flows-query.ts index 604172569..b01bf8df3 100644 --- a/src/frontend/src/controllers/API/queries/flows/use-get-refresh-flows-query.ts +++ b/src/frontend/src/controllers/API/queries/flows/use-get-refresh-flows-query.ts @@ -9,6 +9,7 @@ import { processFlows, } from "@/utils/reactflowUtils"; import { UseQueryOptions } from "@tanstack/react-query"; +import { AxiosError } from "axios"; import { api } from "../../api"; import { getURL } from "../../helpers/constants"; import { UseRequestProcessor } from "../../services/request-processor"; @@ -74,9 +75,11 @@ export const useGetRefreshFlowsQuery: useQueryFunctionType< return []; } catch (e) { - setErrorData({ - title: "Could not load flows from database", - }); + if (e instanceof AxiosError && e.status !== 403) { + setErrorData({ + title: "Could not load flows from database", + }); + } throw e; } }; diff --git a/src/frontend/src/controllers/API/queries/flows/use-get-refresh-flows.ts b/src/frontend/src/controllers/API/queries/flows/use-get-refresh-flows.ts index 37208bf7c..ca65bcb5e 100644 --- a/src/frontend/src/controllers/API/queries/flows/use-get-refresh-flows.ts +++ b/src/frontend/src/controllers/API/queries/flows/use-get-refresh-flows.ts @@ -9,6 +9,7 @@ import { processFlows, } from "@/utils/reactflowUtils"; import { UseMutationOptions } from "@tanstack/react-query"; +import { AxiosError } from "axios"; import { api } from "../../api"; import { getURL } from "../../helpers/constants"; import { UseRequestProcessor } from "../../services/request-processor"; @@ -77,9 +78,11 @@ export const useGetRefreshFlows: useMutationFunctionType< return []; } catch (e) { - setErrorData({ - title: "Could not load flows from database", - }); + if (e instanceof AxiosError && e.status !== 403) { + setErrorData({ + title: "Could not load flows from database", + }); + } throw e; } };