From 4ee7ff1019aa47a9537e8f38de9bb82b3bfbd5ca Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 19 Jan 2024 20:31:09 +0700 Subject: [PATCH] Update subgraph format --- src/components/SpaceProposalBoost.vue | 4 +- src/components/SpaceProposalBoostItem.vue | 10 ++--- src/helpers/boost/subgraph.ts | 53 +++++++++++------------ src/helpers/interfaces.ts | 17 ++++---- 4 files changed, 38 insertions(+), 46 deletions(-) diff --git a/src/components/SpaceProposalBoost.vue b/src/components/SpaceProposalBoost.vue index 27503928472..7be542878e7 100644 --- a/src/components/SpaceProposalBoost.vue +++ b/src/components/SpaceProposalBoost.vue @@ -32,7 +32,7 @@ const isActive = computed(() => props.proposal.state === 'active'); const isFinal = computed(() => props.proposal.scores_state === 'final'); function isEligible(boost: BoostSubgraphResult) { - const choice = boost.strategy.params.eligibility.choice; + const choice = boost.strategy.eligibility.choice; if (!web3Account.value) return false; if (props.proposal.privacy === 'shutter' && !isFinal.value) return false; @@ -92,7 +92,7 @@ async function loadBoosts() { const responses = await Promise.all(requests); boosts.value = responses - .map(response => response.proposal?.boosts) + .map(response => response.boosts) .filter(boost => boost) .flat(); } catch (e) { diff --git a/src/components/SpaceProposalBoostItem.vue b/src/components/SpaceProposalBoostItem.vue index dc016ce1720..a15b837cd7e 100644 --- a/src/components/SpaceProposalBoostItem.vue +++ b/src/components/SpaceProposalBoostItem.vue @@ -65,12 +65,10 @@ const claimedAmount = computed(() => { >
-