fix the error type
This commit is contained in:
@@ -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,
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user