diff --git a/src/api/SwaggerApi.js b/src/api/SwaggerApi.js index 6f5457f4d23a6329517f1c36e1a848fa51e26e5e..606a341a3bf98811960ab22b8fdf77736991444d 100644 --- a/src/api/SwaggerApi.js +++ b/src/api/SwaggerApi.js @@ -387,15 +387,6 @@ export function useHost(id, onError) { return useAsync({ fcn: boundMethod, onError: onError }); } -export function useCSentryHost(onError) { - const api = useContext(apiContext); - const method = useCallAndUnpack( - (id) => api.apis.Hosts.findCSentryHostById({ host_csentry_id: id }), - unpackHost - ); - return useAsync({ fcn: method, call: false, onError: onError }); -} - export function unpackCSEntryHost(host) { return { ...host }; } diff --git a/src/components/deployments/DeploymentDetailFetcher.js b/src/components/deployments/DeploymentDetailFetcher.js deleted file mode 100644 index fc9c4fd5919ca1c3056f6eb985629ae18eceec30..0000000000000000000000000000000000000000 --- a/src/components/deployments/DeploymentDetailFetcher.js +++ /dev/null @@ -1,34 +0,0 @@ -import { useEffect } from "react"; -import { useTagsAndCommitIds, useCSentryHost } from "../../api/SwaggerApi"; - -function onError(message) { - console.warn(message); -} - -export function DeploymentDetailFetcher({ deployment, index, setDeployments }) { - const [tagOrCommitId, getTagOrCommitId] = useTagsAndCommitIds(onError); - const [host, getHost] = useCSentryHost(onError); - - useEffect(() => { - getTagOrCommitId( - deployment.gitProjectId, - deployment.gitReference, - false, - "EQUALS" - ); - getHost(deployment.host.externalHostId); - }, [deployment, getTagOrCommitId, getHost]); - - useEffect(() => { - setDeployments((deployments) => { - deployments[index].sourceVersionShort = - tagOrCommitId?.length === 1 - ? tagOrCommitId[0].shortReference - : deployments[index].sourceVersionShort; - deployments[index].host = host ?? deployments[index].host; - return [...deployments]; - }); - }, [index, setDeployments, tagOrCommitId, host]); - - return null; -} diff --git a/src/components/deployments/index.js b/src/components/deployments/index.js index 22bcc7f7d534f1976694347921a96b9499e7de84..61387f3f947dbd70682b503957c27c584e6392e4 100644 --- a/src/components/deployments/index.js +++ b/src/components/deployments/index.js @@ -1,5 +1,4 @@ import { DeploymentBadge } from "./DeploymentBadge"; -import { DeploymentDetailFetcher } from "./DeploymentDetailFetcher"; import { DeploymentDetails } from "./DeploymentDetails"; import { DeploymentStatusIcon } from "./DeploymentIcons"; import { DeploymentJobOutput } from "./DeploymentJobOutput"; @@ -8,7 +7,6 @@ import { DeploymentStepper } from "./DeploymentStepper"; export { DeploymentBadge, - DeploymentDetailFetcher, DeploymentDetails, DeploymentStatusIcon, DeploymentJobOutput,