diff --git a/apps/web/src/pages/api/og/proposal.tsx b/apps/web/src/pages/api/og/proposal.tsx
index be8b4a1ab..fe71a11c7 100644
--- a/apps/web/src/pages/api/og/proposal.tsx
+++ b/apps/web/src/pages/api/og/proposal.tsx
@@ -85,7 +85,10 @@ const ptRootBold = fetch(
export type ProposalOgMetadata = {
daoName: string
daoImage: string
- proposal: Proposal
+ proposal: Pick<
+ Proposal,
+ 'proposalNumber' | 'title' | 'status' | 'forVotes' | 'againstVotes' | 'abstainVotes'
+ >
}
export default async function handler(req: NextRequest) {
@@ -152,7 +155,14 @@ export default async function handler(req: NextRequest) {
{data.daoName}
diff --git a/apps/web/src/pages/dao/[token]/vote/[id].tsx b/apps/web/src/pages/dao/[token]/vote/[id].tsx
index 4b31c7659..72e4a2c47 100644
--- a/apps/web/src/pages/dao/[token]/vote/[id].tsx
+++ b/apps/web/src/pages/dao/[token]/vote/[id].tsx
@@ -23,6 +23,7 @@ import {
isProposalOpen,
} from 'src/modules/proposal'
import { NextPageWithLayout } from 'src/pages/_app'
+import { ProposalOgMetadata } from 'src/pages/api/og/proposal'
import { propPageWrapper } from 'src/styles/Proposals.css'
export interface VotePageProps {
@@ -140,16 +141,23 @@ export const getServerSideProps: GetServerSideProps = async (context) => {
}
}
+ const ogMetadata: ProposalOgMetadata = {
+ proposal: {
+ proposalNumber: proposal.proposalNumber,
+ title: proposal.title,
+ status: proposal.status,
+ forVotes: proposal.forVotes,
+ againstVotes: proposal.againstVotes,
+ abstainVotes: proposal.abstainVotes,
+ },
+ daoName,
+ daoImage,
+ }
+
const protocol = process.env.VERCEL_ENV === 'development' ? 'http' : 'https'
const ogImageURL = `${protocol}://${
context.req.headers.host
- }/api/og/proposal?data=${encodeURIComponent(
- JSON.stringify({
- proposal,
- daoName,
- daoImage,
- })
- )}`
+ }/api/og/proposal?data=${encodeURIComponent(JSON.stringify(ogMetadata))}`
return {
props: {