From 85cb304f55ab7e0782ac10fc4014bd5f7759e61d Mon Sep 17 00:00:00 2001 From: Shreerang Kale Date: Tue, 24 Jun 2025 22:25:38 +0530 Subject: [PATCH] Handle auction not found error --- .../project/overview/Activity/AuctionCard.tsx | 5 +++++ .../src/pages/org-slug/projects/id/Overview.tsx | 2 +- packages/gql-client/src/client.ts | 15 +++++++++++++-- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/packages/frontend/src/components/projects/project/overview/Activity/AuctionCard.tsx b/packages/frontend/src/components/projects/project/overview/Activity/AuctionCard.tsx index 9dd11859..2cb8a701 100644 --- a/packages/frontend/src/components/projects/project/overview/Activity/AuctionCard.tsx +++ b/packages/frontend/src/components/projects/project/overview/Activity/AuctionCard.tsx @@ -43,6 +43,11 @@ export const AuctionCard = ({ project }: { project: Project }) => { const checkAuctionStatus = useCallback(async () => { const result = await client.getAuctionData(project.auctionId); + + if (!result) { + return + } + setAuctionStatus(result.status); setAuctionDetails(result); }, [project.auctionId, project.deployers, project.fundsReleased]); diff --git a/packages/frontend/src/pages/org-slug/projects/id/Overview.tsx b/packages/frontend/src/pages/org-slug/projects/id/Overview.tsx index 52618aa8..ffb0eea1 100644 --- a/packages/frontend/src/pages/org-slug/projects/id/Overview.tsx +++ b/packages/frontend/src/pages/org-slug/projects/id/Overview.tsx @@ -204,7 +204,7 @@ const OverviewTabPanel = () => { {project.deployments && project.deployments.length > 0 && project.deployments.map((deployment) => ( -
+
{deployment.applicationDeploymentRecordData.url} diff --git a/packages/gql-client/src/client.ts b/packages/gql-client/src/client.ts index 49ddbb60..81ae2ac5 100644 --- a/packages/gql-client/src/client.ts +++ b/packages/gql-client/src/client.ts @@ -414,14 +414,25 @@ export class GQLClient { return data; } - async getAuctionData(auctionId: string): Promise { - const { data } = await this.client.query({ + async getAuctionData(auctionId: string): Promise { + const { data, errors } = await this.client.query({ query: queries.getAuctionData, variables: { auctionId, }, }); + + if (errors && errors.length) { + const isAuctionNotFound = errors.some((error) => + error.message?.includes('Auction not found') + ); + + if (isAuctionNotFound) { + return data; + } + } + return data.getAuctionData; }