Skip to content

Commit 2c2e225

Browse files
update queries inline with ponder update
1 parent cb1f619 commit 2c2e225

3 files changed

Lines changed: 19 additions & 10 deletions

File tree

packages/nextjs/hooks/useCohortAddBuilderEvents.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import contracts from "~~/generated/hardhat_contracts";
44
const BuildersQuery = gql`
55
query Builders($cohortAddress: String!) {
66
cohortBuilders(where: { cohortContractAddress: $cohortAddress }, orderBy: "timestamp", orderDirection: "desc") {
7-
id
7+
items {
8+
id
9+
}
810
}
911
}
1012
`;
@@ -17,6 +19,6 @@ export const useAddBuilderEvents = () => {
1719
},
1820
});
1921

20-
const data = addBuilderEventsData?.cohortBuilders || [];
22+
const data = addBuilderEventsData?.cohortBuilders.items || [];
2123
return { data, isLoading };
2224
};

packages/nextjs/hooks/useCohortWithdrawEvents.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ import contracts from "~~/generated/hardhat_contracts";
44
const WithdrawalsQuery = gql`
55
query Withdrawls($cohortAddress: String!) {
66
cohortWithdrawals(where: { cohortContractAddress: $cohortAddress }, orderBy: "timestamp", orderDirection: "desc") {
7-
reason
8-
builder
9-
amount
10-
timestamp
11-
id
7+
items {
8+
reason
9+
builder
10+
amount
11+
timestamp
12+
id
13+
}
1214
}
1315
}
1416
`;
@@ -28,7 +30,7 @@ export const useCohortWithdrawEvents = () => {
2830
// },
2931
// });
3032

31-
const newContractWithdrawEvents = newWithdrawEventsData?.cohortWithdrawals || [];
33+
const newContractWithdrawEvents = newWithdrawEventsData?.cohortWithdrawals.items || [];
3234
//const oldContractWithdrawEvents = oldWithdrawEventsData?.cohortWithdrawals || [];
3335

3436
const data = [...newContractWithdrawEvents /*, ...oldContractWithdrawEvents*/];

packages/nextjs/pages/members.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,14 @@ const Members: NextPage = () => {
4040

4141
useEffect(() => {
4242
if (selectedAddress) {
43-
setFilteredEvents(allWithdrawEvents?.filter((event: any) => event.builder === selectedAddress) || []);
43+
setFilteredEvents(
44+
allWithdrawEvents?.filter((event: any) => {
45+
return event.builder.toLowerCase() === selectedAddress.toLowerCase();
46+
}) || [],
47+
);
4448
}
45-
}, [selectedAddress, allWithdrawEvents]);
49+
// eslint-disable-next-line react-hooks/exhaustive-deps
50+
}, [selectedAddress]);
4651

4752
return (
4853
<>

0 commit comments

Comments
 (0)