1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-22 14:59:41 +02:00

feat(helm): auto refresh helm resources [r8s-298] (#672)

This commit is contained in:
Ali 2025-04-23 08:58:21 +12:00 committed by GitHub
parent 9a9373dd0f
commit 61d6ac035d
10 changed files with 120 additions and 50 deletions

View file

@ -16,19 +16,22 @@ export function useHelmRelease<T = HelmRelease>(
options: {
select?: (data: HelmRelease) => T;
showResources?: boolean;
refetchInterval?: number;
} = {}
) {
const { select, showResources, refetchInterval } = options;
return useQuery(
[environmentId, 'helm', 'releases', namespace, name, options.showResources],
() =>
getHelmRelease(environmentId, name, {
namespace,
showResources: options.showResources,
showResources,
}),
{
enabled: !!environmentId && !!name && !!namespace,
...withGlobalError('Unable to retrieve helm application details'),
select: options.select,
select,
refetchInterval,
}
);
}