From fd89b3c702eccd34ede12850ba54a893bc99d17a Mon Sep 17 00:00:00 2001 From: Scott Wilson Date: Wed, 6 Aug 2025 15:42:27 -0700 Subject: [PATCH] fix: correctly parse audit log error message --- frontend/src/hooks/api/auditLogs/queries.tsx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/frontend/src/hooks/api/auditLogs/queries.tsx b/frontend/src/hooks/api/auditLogs/queries.tsx index b254b46d3..8cb438c92 100644 --- a/frontend/src/hooks/api/auditLogs/queries.tsx +++ b/frontend/src/hooks/api/auditLogs/queries.tsx @@ -1,8 +1,7 @@ import { useInfiniteQuery, useQuery } from "@tanstack/react-query"; -import { AxiosError } from "axios"; -import { createNotification } from "@app/components/notifications"; import { apiRequest } from "@app/config/request"; +import { onRequestError } from "@app/hooks/api/reactQuery"; import { TReactQueryOptions } from "@app/types/reactQuery"; import { Actor, AuditLog, TGetAuditLogsFilter } from "./types"; @@ -46,12 +45,7 @@ export const useGetAuditLogs = ( ); return data.auditLogs; } catch (error) { - if (error instanceof AxiosError) { - createNotification({ - type: "error", - text: error.response?.data.message - }); - } + onRequestError(error); return []; } },