Fix endless loop
Signed-off-by: Jonathan Mezach <jonathan.mezach@rr-wfm.com>
This commit is contained in:
+3
-3
@@ -28,11 +28,11 @@ export const EntityPageOctopusDeploy = (props: { defaultLimit?: number }) => {
|
||||
const projectId = getProjectIdAnnotationFromEntity(entity);
|
||||
const spaceId = getSpaceIdAnnotationFromEntity(entity);
|
||||
|
||||
const { environments, releases, loading, error } = useReleases({
|
||||
const { environments, releases, loading, error } = useReleases(
|
||||
projectId,
|
||||
props.defaultLimit ?? 3,
|
||||
spaceId,
|
||||
releaseHistoryCount: props.defaultLimit ?? 3,
|
||||
});
|
||||
);
|
||||
|
||||
return (
|
||||
<ReleaseTable
|
||||
|
||||
@@ -21,11 +21,11 @@ import {
|
||||
OctopusReleaseProgression,
|
||||
} from '../api';
|
||||
|
||||
export function useReleases(opts: {
|
||||
projectId: string;
|
||||
spaceId?: string;
|
||||
releaseHistoryCount: number;
|
||||
}): {
|
||||
export function useReleases(
|
||||
projectId: string,
|
||||
releaseHistoryCount: number,
|
||||
spaceId?: string,
|
||||
): {
|
||||
environments?: OctopusEnvironment[];
|
||||
releases?: OctopusReleaseProgression[];
|
||||
loading: boolean;
|
||||
@@ -34,8 +34,12 @@ export function useReleases(opts: {
|
||||
const api = useApi(octopusDeployApiRef);
|
||||
|
||||
const { value, loading, error } = useAsync(() => {
|
||||
return api.getReleaseProgression(opts);
|
||||
}, [api, opts]);
|
||||
return api.getReleaseProgression({
|
||||
projectId,
|
||||
spaceId,
|
||||
releaseHistoryCount,
|
||||
});
|
||||
}, [api, projectId, spaceId, releaseHistoryCount]);
|
||||
|
||||
return {
|
||||
environments: value?.Environments,
|
||||
|
||||
Reference in New Issue
Block a user