mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-04 16:26:16 +00:00
fix: correctly parse audit log error message
This commit is contained in:
@@ -1,8 +1,7 @@
|
|||||||
import { useInfiniteQuery, useQuery } from "@tanstack/react-query";
|
import { useInfiniteQuery, useQuery } from "@tanstack/react-query";
|
||||||
import { AxiosError } from "axios";
|
|
||||||
|
|
||||||
import { createNotification } from "@app/components/notifications";
|
|
||||||
import { apiRequest } from "@app/config/request";
|
import { apiRequest } from "@app/config/request";
|
||||||
|
import { onRequestError } from "@app/hooks/api/reactQuery";
|
||||||
import { TReactQueryOptions } from "@app/types/reactQuery";
|
import { TReactQueryOptions } from "@app/types/reactQuery";
|
||||||
|
|
||||||
import { Actor, AuditLog, TGetAuditLogsFilter } from "./types";
|
import { Actor, AuditLog, TGetAuditLogsFilter } from "./types";
|
||||||
@@ -46,12 +45,7 @@ export const useGetAuditLogs = (
|
|||||||
);
|
);
|
||||||
return data.auditLogs;
|
return data.auditLogs;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error instanceof AxiosError) {
|
onRequestError(error);
|
||||||
createNotification({
|
|
||||||
type: "error",
|
|
||||||
text: error.response?.data.message
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user