fix the error type

This commit is contained in:
Kristina Durivage
2025-12-11 13:27:13 -06:00
parent a44eb98456
commit c0147297b7
2 changed files with 7 additions and 2 deletions
@@ -49,7 +49,7 @@ function CorrelationsPageAppPlatform() {
totalCount: totalItems.current,
}}
isLoading={isLoading}
error={error as Error}
error={error}
removeFn={(params: RemoveCorrelationParams) => {
const deleteData = deleteCorrelation({ name: params.uid });
return deleteData.unwrap();
@@ -62,11 +62,16 @@ export const useCorrelationsK8s = (limit = 100, page: number) => {
currentData !== undefined
? pagedData.map((item) => toEnrichedCorrelationDataK8s(item)).filter((i) => i !== undefined)
: [];
let fmtedError = undefined;
if (error !== undefined) {
fmtedError = new Error(error?.toString() ?? 'useListCorrelationQuery error');
}
return {
currentData: enrichedCorrelations,
isLoading,
error,
error: fmtedError,
remainingItems: currentData?.metadata.remainingItemCount || 0,
};
};