diff --git a/frontend/hub/namespaces/HubNamespaceDetails.tsx b/frontend/hub/namespaces/HubNamespaceDetails.tsx index b6d9c1ffee..9b3b178aa4 100644 --- a/frontend/hub/namespaces/HubNamespaceDetails.tsx +++ b/frontend/hub/namespaces/HubNamespaceDetails.tsx @@ -12,7 +12,7 @@ import { import { PageDetailsFromColumns } from '../../../framework'; import { RouteObj } from '../../Routes'; import { useGet } from '../../common/crud/useGet'; -import { HubItemsResponse } from '../useHubView'; +import { HubNamespaceResponse } from '../useHubView'; import { HubNamespace } from './HubNamespace'; import { useHubView } from '../useHubView'; import { useHubNamespaceActions } from './hooks/useHubNamespaceActions'; @@ -29,17 +29,11 @@ import { DropdownPosition } from '@patternfly/react-core'; export function NamespaceDetails() { const { t } = useTranslation(); const params = useParams<{ id: string }>(); - const { data } = useGet>( + const { data } = useGet>( `/api/automation-hub/pulp/api/v3/pulp_ansible/namespaces/?limit=1&name=${params.id ?? ''}` ); let namespace: HubNamespace | undefined = undefined; - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore if (data && data.results && data.count > 0) { - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment namespace = data.results[0]; } diff --git a/frontend/hub/useHubView.tsx b/frontend/hub/useHubView.tsx index 4825b95cf9..7cd5b0ea7d 100644 --- a/frontend/hub/useHubView.tsx +++ b/frontend/hub/useHubView.tsx @@ -22,6 +22,11 @@ export interface HubItemsResponse { }; } +export interface HubNamespaceResponse { + count: number; + results: T[]; +} + export type IHubView = IView & ISelected & { itemCount: number | undefined;