From 25283da940647efc6ebe7ca4b941d49bd90de54d Mon Sep 17 00:00:00 2001 From: IshaVenikar Date: Tue, 22 Oct 2024 19:20:06 +0530 Subject: [PATCH] Remove useCallback for fetching logs --- packages/backend/src/service.ts | 6 +++--- .../project/deployments/DeploymentDetailsCard.tsx | 12 ++++-------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/packages/backend/src/service.ts b/packages/backend/src/service.ts index 318e0c9b..cfc4fc49 100644 --- a/packages/backend/src/service.ts +++ b/packages/backend/src/service.ts @@ -334,9 +334,9 @@ export class Service { await this.updateProjectWithDeployer(project.id, deployer); } - for (const deployer of deployerIds) { - log(`Creating deployment for deployer LRN ${deployer}`); - await this.createDeploymentFromAuction(project, deployer); + for (const deployerId of deployerIds) { + log(`Creating deployment for deployer ${deployerId}`); + await this.createDeploymentFromAuction(project, deployerId); } } } diff --git a/packages/frontend/src/components/projects/project/deployments/DeploymentDetailsCard.tsx b/packages/frontend/src/components/projects/project/deployments/DeploymentDetailsCard.tsx index b8abe55b..fa6142e9 100644 --- a/packages/frontend/src/components/projects/project/deployments/DeploymentDetailsCard.tsx +++ b/packages/frontend/src/components/projects/project/deployments/DeploymentDetailsCard.tsx @@ -91,7 +91,7 @@ const DeploymentDetailsCard = ({ } }; - const fetchDeploymentLogs = useCallback(async () => { + const fetchDeploymentLogs = async () => { let url = `${deployment.deployer.deployerApiUrl}/log/${deployment.applicationDeploymentRequestId}`; const res = await fetch(url, { cache: 'no-store' }); handleOpenDialog(); @@ -99,11 +99,7 @@ const DeploymentDetailsCard = ({ const logs = await res.text(); setDeploymentLogs(logs); } - }, [ - deployment.deployer.deployerApiUrl, - deployment.applicationDeploymentRequestId, - handleOpenDialog, - ]); + }; const renderDeploymentStatus = useCallback( (className?: string) => { @@ -189,8 +185,8 @@ const DeploymentDetailsCard = ({ type="orange" initials={getInitials(deployment.createdBy.name ?? '')} className="lg:size-5 2xl:size-6" - // TODO: Add avatarUrl - // imageSrc={deployment.createdBy.avatarUrl} + // TODO: Add avatarUrl + // imageSrc={deployment.createdBy.avatarUrl} >