diff --git a/apps/console/src/hooks/graph/TrustCenterAccessGraph.ts b/apps/console/src/hooks/graph/TrustCenterAccessGraph.ts index 64c25eccb..8c22ae77c 100644 --- a/apps/console/src/hooks/graph/TrustCenterAccessGraph.ts +++ b/apps/console/src/hooks/graph/TrustCenterAccessGraph.ts @@ -1,5 +1,9 @@ import { graphql } from 'react-relay'; import { useLazyLoadQuery } from 'react-relay'; +import type { + TrustCenterAccessGraphQuery, + TrustCenterAccessGraphQuery$data +} from "./__generated__/TrustCenterAccessGraphQuery.graphql"; export const trustCenterAccessesQuery = graphql` query TrustCenterAccessGraphQuery($trustCenterId: ID!) { @@ -90,6 +94,6 @@ export const deleteTrustCenterAccessMutation = graphql` } `; -export function useTrustCenterAccesses(trustCenterId: string) { - return useLazyLoadQuery(trustCenterAccessesQuery, { trustCenterId }); +export function useTrustCenterAccesses(trustCenterId: string): TrustCenterAccessGraphQuery$data { + return useLazyLoadQuery(trustCenterAccessesQuery, { trustCenterId }); } diff --git a/apps/console/src/pages/organizations/trustCenter/TrustCenterAccessTab.tsx b/apps/console/src/pages/organizations/trustCenter/TrustCenterAccessTab.tsx index 7f61f152c..2635c210b 100644 --- a/apps/console/src/pages/organizations/trustCenter/TrustCenterAccessTab.tsx +++ b/apps/console/src/pages/organizations/trustCenter/TrustCenterAccessTab.tsx @@ -9,7 +9,6 @@ import { deleteTrustCenterAccessMutation } from "/hooks/graph/TrustCenterAccessGraph"; import { useMutation } from "react-relay"; -import type { TrustCenterAccessGraphQuery$data } from "/hooks/graph/__generated__/TrustCenterAccessGraphQuery.graphql"; type ContextType = { organization: { @@ -41,7 +40,7 @@ export default function TrustCenterAccessTab() { createdAt: Date; }; - const data = useTrustCenterAccesses(organization.trustCenter?.id || ""); + const trustCenterData = useTrustCenterAccesses(organization.trustCenter?.id || ""); if (!organization.trustCenter?.id) { return ( @@ -63,7 +62,6 @@ export default function TrustCenterAccessTab() { ); } - const trustCenterData = data as TrustCenterAccessGraphQuery$data | null; const accesses: AccessType[] = trustCenterData?.node?.accesses?.edges ? trustCenterData.node.accesses.edges.map(edge => ({ id: edge.node.id, @@ -343,13 +341,6 @@ export default function TrustCenterAccessTab() { -