diff --git a/packages/nextjs/hooks/useCohortAddBuilderEvents.ts b/packages/nextjs/hooks/useCohortAddBuilderEvents.ts index 29e3be3..b9f6ea2 100644 --- a/packages/nextjs/hooks/useCohortAddBuilderEvents.ts +++ b/packages/nextjs/hooks/useCohortAddBuilderEvents.ts @@ -4,7 +4,9 @@ import contracts from "~~/generated/hardhat_contracts"; const BuildersQuery = gql` query Builders($cohortAddress: String!) { cohortBuilders(where: { cohortContractAddress: $cohortAddress }, orderBy: "timestamp", orderDirection: "desc") { - id + items { + id + } } } `; @@ -17,6 +19,6 @@ export const useAddBuilderEvents = () => { }, }); - const data = addBuilderEventsData?.cohortBuilders || []; + const data = addBuilderEventsData?.cohortBuilders.items || []; return { data, isLoading }; }; diff --git a/packages/nextjs/hooks/useCohortWithdrawEvents.ts b/packages/nextjs/hooks/useCohortWithdrawEvents.ts index a6293ed..4d6ae3f 100644 --- a/packages/nextjs/hooks/useCohortWithdrawEvents.ts +++ b/packages/nextjs/hooks/useCohortWithdrawEvents.ts @@ -4,11 +4,13 @@ import contracts from "~~/generated/hardhat_contracts"; const WithdrawalsQuery = gql` query Withdrawls($cohortAddress: String!) { cohortWithdrawals(where: { cohortContractAddress: $cohortAddress }, orderBy: "timestamp", orderDirection: "desc") { - reason - builder - amount - timestamp - id + items { + reason + builder + amount + timestamp + id + } } } `; @@ -28,7 +30,7 @@ export const useCohortWithdrawEvents = () => { // }, // }); - const newContractWithdrawEvents = newWithdrawEventsData?.cohortWithdrawals || []; + const newContractWithdrawEvents = newWithdrawEventsData?.cohortWithdrawals.items || []; //const oldContractWithdrawEvents = oldWithdrawEventsData?.cohortWithdrawals || []; const data = [...newContractWithdrawEvents /*, ...oldContractWithdrawEvents*/]; diff --git a/packages/nextjs/pages/_app.tsx b/packages/nextjs/pages/_app.tsx index cfcff2a..69a0f32 100644 --- a/packages/nextjs/pages/_app.tsx +++ b/packages/nextjs/pages/_app.tsx @@ -19,7 +19,7 @@ import "~~/styles/globals.css"; const shareTechMono = Share_Tech_Mono({ subsets: ["latin"], weight: "400" }); const urqlClient = new Client({ - url: "https://bg-ponder-indexer-production.up.railway.app/", + url: "http://localhost:42069", exchanges: [cacheExchange, fetchExchange], }); diff --git a/packages/nextjs/pages/members.tsx b/packages/nextjs/pages/members.tsx index a4ad393..0a4d9c1 100644 --- a/packages/nextjs/pages/members.tsx +++ b/packages/nextjs/pages/members.tsx @@ -40,9 +40,14 @@ const Members: NextPage = () => { useEffect(() => { if (selectedAddress) { - setFilteredEvents(allWithdrawEvents?.filter((event: any) => event.builder === selectedAddress) || []); + setFilteredEvents( + allWithdrawEvents?.filter((event: any) => { + return event.builder.toLowerCase() === selectedAddress.toLowerCase(); + }) || [], + ); } - }, [selectedAddress, allWithdrawEvents]); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [selectedAddress]); return ( <>