Skip to content

Commit

Permalink
fix(RHINENG-9248): fetch non-edge hosts
Browse files Browse the repository at this point in the history
For the new bootc image table, we request the non-image based system count to include at the bottom of the table. This PR modifies the api call to request to filter by non-edge based systems so we get a count of systems that matches the system table.
  • Loading branch information
Michael Johnson authored and johnsonm325 committed Apr 25, 2024
1 parent fd9bff4 commit 520c0f3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/Utilities/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ export const INVENTORY_FETCH_BOOTC_PARAMS =
export const INVENTORY_FETCH_BOOTC = `${INVENTORY_FETCH_BOOTC_PARAMS}=not_nil`;
export const INVENTORY_FETCH_NON_BOOTC = `${INVENTORY_FETCH_BOOTC_PARAMS}=nil`;
export const INVENTORY_TOTAL_FETCH_BOOTC_PARAMS = `${INVENTORY_FETCH_BOOTC}&per_page=1`;
export const INVENTORY_FILTER_NO_HOST_TYPE =
'filter[system_profile][host_type]=nil';
export function subtractDate(days) {
const date = new Date();
date.setDate(date.getDate() - days);
Expand Down
3 changes: 2 additions & 1 deletion src/routes/InventoryComponents/BifrostPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import axios from 'axios';
import {
INVENTORY_FETCH_BOOTC,
INVENTORY_FETCH_NON_BOOTC,
INVENTORY_FILTER_NO_HOST_TYPE,
INVENTORY_TOTAL_FETCH_URL_SERVER,
} from '../../Utilities/constants';
import BifrostTable from './BifrostTable';
Expand All @@ -19,7 +20,7 @@ const BifrostPage = () => {
);

const packageBasedSystems = await axios.get(
`${INVENTORY_TOTAL_FETCH_URL_SERVER}${INVENTORY_FETCH_NON_BOOTC}&per_page=1`
`${INVENTORY_TOTAL_FETCH_URL_SERVER}${INVENTORY_FETCH_NON_BOOTC}&${INVENTORY_FILTER_NO_HOST_TYPE}&per_page=1`
);

const booted = result.data.results.map(
Expand Down

0 comments on commit 520c0f3

Please sign in to comment.