Skip to content

Commit

Permalink
chore: minor change to query
Browse files Browse the repository at this point in the history
  • Loading branch information
amlannandy committed Jan 29, 2025
1 parent df29098 commit a2578df
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions frontend/src/container/InfraMonitoringHosts/HostsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,18 @@ function HostsList(): JSX.Element {

const { pageSize, setPageSize } = usePageSize('hosts');

const baseQuery = getHostListsQuery();
const query = useMemo(
() => ({
const query = useMemo(() => {
const baseQuery = getHostListsQuery();
return {
...baseQuery,
limit: pageSize,
offset: (currentPage - 1) * pageSize,
filters,
start: Math.floor(minTime / 1000000),
end: Math.floor(maxTime / 1000000),
orderBy,
}),
[baseQuery, pageSize, currentPage, filters, minTime, maxTime, orderBy],
);
};
}, [pageSize, currentPage, filters, minTime, maxTime, orderBy]);

const { data, isFetching, isLoading, isError } = useGetHostList(
query as HostListPayload,
Expand Down

0 comments on commit a2578df

Please sign in to comment.