From 8e801d00887cf28da04f49c82528f5d1a4429462 Mon Sep 17 00:00:00 2001 From: Ian Philips Date: Mon, 1 Aug 2022 10:15:19 -0600 Subject: [PATCH] Parse please --- og-image/api/_lib/parser.ts | 4 ++-- og-image/api/_lib/template.ts | 4 ++-- og-image/api/_lib/types.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/og-image/api/_lib/parser.ts b/og-image/api/_lib/parser.ts index dab8591d..a335fe48 100644 --- a/og-image/api/_lib/parser.ts +++ b/og-image/api/_lib/parser.ts @@ -71,8 +71,8 @@ export function parseRequest(req: IncomingMessage) { creatorName: getString(creatorName) || 'Manifold Markets', creatorUsername: getString(creatorUsername) || 'ManifoldMarkets', creatorAvatarUrl: getString(creatorAvatarUrl) || '', - challengeAmount: getString(challengeAmount), - challengeOutcome: getString(challengeOutcome), + challengeAmount: getString(challengeAmount) || '', + challengeOutcome: getString(challengeOutcome) || '', } parsedRequest.images = getDefaultImages(parsedRequest.images) return parsedRequest diff --git a/og-image/api/_lib/template.ts b/og-image/api/_lib/template.ts index 7285bc15..5f795c58 100644 --- a/og-image/api/_lib/template.ts +++ b/og-image/api/_lib/template.ts @@ -151,10 +151,10 @@ export function getHtml(parsedReq: ParsedRequest) {
${ - challengeAmount ? 'M$' + challengeAmount : probability + challengeAmount !== '' ? 'M$' + challengeAmount : probability }
${ - challengeOutcome ? 'on' + challengeOutcome : '' + challengeOutcome !== '' ? 'on' + challengeOutcome : '' }
${probability !== '' ? 'chance' : ''}
diff --git a/og-image/api/_lib/types.ts b/og-image/api/_lib/types.ts index 3b7f9a2d..eb8b412d 100644 --- a/og-image/api/_lib/types.ts +++ b/og-image/api/_lib/types.ts @@ -18,6 +18,6 @@ export interface ParsedRequest { creatorName: string creatorUsername: string creatorAvatarUrl: string - challengeAmount: string | undefined - challengeOutcome: string | undefined + challengeAmount: string + challengeOutcome: string }