Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/api mock #17

Merged
merged 6 commits into from
Jan 10, 2024
Merged

Feat/api mock #17

merged 6 commits into from
Jan 10, 2024

Conversation

tplocic20
Copy link
Contributor

Added zustand store and implemented it for all api calls

@tplocic20 tplocic20 requested a review from AnnaJ-P11 January 8, 2024 09:15
Copy link

vercel bot commented Jan 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
governance-ui ❌ Failed (Inspect) Jan 10, 2024 8:57am

@@ -26,10 +27,10 @@ const Page = () => {
Mento
</div>
<div className="hidden gap-x1 md:flex">
<Button theme="clear" href="/create-proposal">
<Button theme="clear" href="/create-proposal" disabled={!walletAddress}>
Copy link
Contributor

@AnnaJ-P11 AnnaJ-P11 Jan 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tutaj wydaje mi się, że disabled nie będzie potrzebny, bo pierwszy step to Podłączenie do walleta gdyby nie był podłączony

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

słusznie, usunę

for: votesResponseJson.filter((vote: IVote) => vote.type === 'for'),
against: votesResponseJson.filter((vote: IVote) => vote.type === 'against'),
abstain: votesResponseJson.filter((vote: IVote) => vote.type === 'abstain'),
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Proponowałabym to dodać do wspólnej funkcji, ten kod powtzraz się w dwóch miejscach

const votesResponse = await fetch(/api/proposals/${id}/votes);

    const votesResponseJson = await votesResponse.json();

    const votes: ProposalVotesMap = {
        for: votesResponseJson.filter((vote: IVote) => vote.type === 'for'),
        against: votesResponseJson.filter((vote: IVote) => vote.type === 'against'),
        abstain: votesResponseJson.filter((vote: IVote) => vote.type === 'abstain'),
    };

@tplocic20 tplocic20 merged commit a955111 into develop Jan 10, 2024
1 of 2 checks passed
@tplocic20 tplocic20 deleted the feat/api-mock branch January 10, 2024 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants