Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions app/proposal/create/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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("/");
},
Expand Down
12 changes: 6 additions & 6 deletions graphqlApi/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
Vote,
User,
} from "@/types";
import { ApiProposal } from "./types";
import { ApiDelegate, ApiProposal } from "./types";
import type {
OrderDirection,
Proposal_OrderBy,
Expand Down Expand Up @@ -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 [];
}
}
Expand All @@ -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 [];
}
}
Expand Down Expand Up @@ -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,
Expand Down
8 changes: 7 additions & 1 deletion graphqlApi/types.ts
Original file line number Diff line number Diff line change
@@ -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;