Skip to content

Commit

Permalink
fixup! fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aleixhub committed Sep 18, 2024
1 parent 65c8cd8 commit 4d4f219
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions catalog/ui/src/app/Catalog/Catalog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ import ListIcon from '@patternfly/react-icons/dist/js/icons/list-icon';
import ThIcon from '@patternfly/react-icons/dist/js/icons/th-icon';
import useSWRImmutable from 'swr/immutable';
import { AsyncParser } from 'json2csv';
import { apiPaths, fetcherItemsInAllPages } from '@app/api';
import { CatalogItem, CatalogItemIncident, CatalogItemIncidents } from '@app/types';
import { apiPaths, fetcher, fetcherItemsInAllPages } from '@app/api';
import { CatalogItem, CatalogItemIncidents } from '@app/types';
import useSession from '@app/utils/useSession';
import SearchInputString from '@app/components/SearchInputString';
import {
Expand Down Expand Up @@ -337,7 +337,8 @@ const Catalog: React.FC<{ userHasRequiredPropertiesToAccess: boolean }> = ({ use
() => fetchCatalog(catalogNamespaceName ? [catalogNamespaceName] : catalogNamespaceNames)
);
const { data: activeIncidents } = useSWRImmutable<CatalogItemIncidents>(
apiPaths.CATALOG_ITEMS_ACTIVE_INCIDENT({ namespace: catalogNamespaceName ? catalogNamespaceName : null })
apiPaths.CATALOG_ITEMS_ACTIVE_INCIDENTS({ namespace: catalogNamespaceName ? catalogNamespaceName : null }),
fetcher
);

const catalogItems = useMemo(
Expand Down
2 changes: 1 addition & 1 deletion catalog/ui/src/app/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1615,7 +1615,7 @@ export const apiPaths: { [key in ResourceType]: (args: any) => string } = {
`/api/catalog_incident/incidents/${asset_uuid}/${namespace}`,
CATALOG_ITEM_LAST_INCIDENT: ({ namespace, asset_uuid }: { namespace: string; asset_uuid: string }) =>
`/api/catalog_incident/last-incident/${asset_uuid}/${namespace}`,
CATALOG_ITEMS_ACTIVE_INCIDENT: ({ namespace }: { namespace?: string }) =>
CATALOG_ITEMS_ACTIVE_INCIDENTS: ({ namespace }: { namespace?: string }) =>
`/api/catalog_incident/active-incidents${namespace ? `?stage=${namespace}` : ''}`,
RESOURCE_CLAIMS: ({
namespace,
Expand Down
2 changes: 1 addition & 1 deletion catalog/ui/src/app/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ export type ResourceType =
| 'CATALOG_ITEMS'
| 'CATALOG_ITEM_INCIDENTS'
| 'CATALOG_ITEM_LAST_INCIDENT'
| 'CATALOG_ITEMS_ACTIVE_INCIDENT'
| 'CATALOG_ITEMS_ACTIVE_INCIDENTS'
| 'RESOURCE_CLAIMS'
| 'RESOURCE_CLAIM'
| 'NAMESPACES'
Expand Down

0 comments on commit 4d4f219

Please sign in to comment.