diff --git a/app/proposal/create/page.tsx b/app/proposal/create/page.tsx index 26e736f..4b89f4f 100644 --- a/app/proposal/create/page.tsx +++ b/app/proposal/create/page.tsx @@ -267,9 +267,7 @@ export default function CreateProposal() { return createProposal(actions, fullDescription); }, - onSuccess: (proposalId) => { - console.log("Proposal created with ID:", proposalId); - + onSuccess: () => { toast.success("Proposal created successfully!"); router.push("/"); }, diff --git a/graphqlApi/index.ts b/graphqlApi/index.ts index c27d512..29e0f6b 100644 --- a/graphqlApi/index.ts +++ b/graphqlApi/index.ts @@ -15,7 +15,7 @@ import { Vote, User, } from "@/types"; -import { ApiProposal } from "./types"; +import { ApiDelegate, ApiProposal } from "./types"; import type { OrderDirection, Proposal_OrderBy, @@ -81,8 +81,8 @@ function formatExecution( // Old RawTransaction format has 'to' return item as RawTransaction; }); - } catch { - console.log("Failed to parse execution"); + } catch (error) { + console.error("Failed to parse execution", error); return []; } } @@ -95,8 +95,8 @@ function formatSimulation( try { const result = JSON.parse(simulation); return Array.isArray(result) ? result : []; - } catch { - console.log("Failed to parse simulation"); + } catch (error) { + console.error("Failed to parse simulation", error); return []; } } @@ -360,7 +360,7 @@ export function createApi(uri: string) { }); return ( - data?.delegates?.map((delegate: any) => ({ + data?.delegates?.map((delegate: ApiDelegate) => ({ id: delegate.id, address: delegate.user?.id ?? "", votingPower: delegate.voting_power, diff --git a/graphqlApi/types.ts b/graphqlApi/types.ts index 925a814..8d7a61f 100644 --- a/graphqlApi/types.ts +++ b/graphqlApi/types.ts @@ -1,5 +1,11 @@ -import { ProposalFieldsFragment, VoteFieldsFragment } from "./gql/graphql"; +import { + DelegateFieldsFragment, + ProposalFieldsFragment, + VoteFieldsFragment, +} from "./gql/graphql"; export type ApiVote = VoteFieldsFragment; export type ApiProposal = ProposalFieldsFragment; + +export type ApiDelegate = DelegateFieldsFragment;