ImageTable: use dynamic get blueprints hook

Export a dynamic query hook depending on which backend is
being used (service or on-prem). This means we can just import
a query from the new `backendApi` and it will work for both
on-prem and the service.
This commit is contained in:
Gianluca Zuccarelli 2024-10-17 18:57:29 +01:00 committed by Lucas Garfield
parent f13ee49565
commit 41cdc7d553
4 changed files with 15 additions and 6 deletions

View file

@ -46,6 +46,7 @@ import {
OCI_STORAGE_EXPIRATION_TIME_IN_DAYS,
STATUS_POLLING_INTERVAL,
} from '../../constants';
import { useGetBlueprintsQuery } from '../../store/backendApi';
import {
selectBlueprintSearchInput,
selectBlueprintVersionFilter,
@ -61,7 +62,6 @@ import {
ComposesResponseItem,
ComposeStatus,
useGetBlueprintComposesQuery,
useGetBlueprintsQuery,
useGetComposesQuery,
useGetComposeStatusQuery,
} from '../../store/imageBuilderApi';
@ -153,7 +153,11 @@ const ImagesTable = () => {
);
}
if (!isSuccess) {
// TODO: the check for `IS_ON_PREMISE` should be removed when
// we create query functions for the other endpoints. We're skipping
// this check because the query request fails, since the `cockpitApi`
// still doesn't know how to query the composes endpoint
if (!process.env.IS_ON_PREMISE && !isSuccess) {
if (isError) {
return (
<Alert variant="warning" title="Service unavailable">