From e043227fed72d1572b0bb2aaf33bd825c9106700 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20Zi=C3=B3=C5=82ek?= Date: Tue, 10 Dec 2024 11:28:06 +0100 Subject: [PATCH] fix: check different field in Karma API --- client/src/api/calls/karmaGap.ts | 8 ++++---- .../Project/ProjectMilestones/ProjectMilestones.tsx | 4 ++-- .../queries/karmaGap/useMilestonesPerGrantPerProgram.ts | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/client/src/api/calls/karmaGap.ts b/client/src/api/calls/karmaGap.ts index 6e666565c2..de164243ed 100644 --- a/client/src/api/calls/karmaGap.ts +++ b/client/src/api/calls/karmaGap.ts @@ -3,6 +3,10 @@ import apiService from 'services/apiService'; export type GrantsPerProgram = { data: { + // externalAddresses is set only when recipient does not match project has in Octant. + externalAddresses?: { + octant: string; + }; milestones: { createdAt: string; data: { @@ -21,10 +25,6 @@ export type GrantsPerProgram = { }; recipient: string; }; - // externalAddresses is set only when recipient does not match project has in Octant. - externalAddresses?: { - octant: string; - }; recipient: string; }; recipient: string; diff --git a/client/src/components/Project/ProjectMilestones/ProjectMilestones.tsx b/client/src/components/Project/ProjectMilestones/ProjectMilestones.tsx index 01b551a3ca..e4ba2aeb75 100644 --- a/client/src/components/Project/ProjectMilestones/ProjectMilestones.tsx +++ b/client/src/components/Project/ProjectMilestones/ProjectMilestones.tsx @@ -10,7 +10,7 @@ import ProjectMilestonesSkeleton from 'components/Project/ProjectMilestonesSkele import Button from 'components/ui/Button'; import Svg from 'components/ui/Svg'; import useMediaQuery from 'hooks/helpers/useMediaQuery'; -import useGrantsPerProgram from 'hooks/queries/karmaGap/useMilestonesPerGrantPerProgram'; +import useMilestonesPerGrantPerProgram from 'hooks/queries/karmaGap/useMilestonesPerGrantPerProgram'; import { pending, completed } from 'svg/projectMilestones'; import styles from './ProjectMilestones.module.scss'; @@ -30,7 +30,7 @@ const ProjectMilestones: FC = ({ projectAddress }) => { const epochNumber = parseInt(epoch!, 10); - const { data, isFetching } = useGrantsPerProgram(epochNumber, projectAddress); + const { data, isFetching } = useMilestonesPerGrantPerProgram(epochNumber, projectAddress); const getDateFormatted = (date: string | number): string => format(date, 'd LLL'); diff --git a/client/src/hooks/queries/karmaGap/useMilestonesPerGrantPerProgram.ts b/client/src/hooks/queries/karmaGap/useMilestonesPerGrantPerProgram.ts index 7007fe4f56..ced7909c82 100644 --- a/client/src/hooks/queries/karmaGap/useMilestonesPerGrantPerProgram.ts +++ b/client/src/hooks/queries/karmaGap/useMilestonesPerGrantPerProgram.ts @@ -17,7 +17,7 @@ export default function useMilestonesPerGrantPerProgram( select: response => response.data.find( element => - element.project.externalAddresses?.octant.toLowerCase() === projectAddressToLowerCase || + element.externalAddresses?.octant.toLowerCase() === projectAddressToLowerCase || element.project.recipient.toLowerCase() === projectAddressToLowerCase || element.project.details.recipient.toLowerCase() === projectAddressToLowerCase, ),