From 1e6b72059e22da4e3d11f0eb8e1c563c61986eae Mon Sep 17 00:00:00 2001 From: Olivia Appleton Date: Thu, 29 Sep 2022 14:17:52 -0400 Subject: [PATCH] Expose multiple choice answer probabilities (#939) * Expose multiple choice answer probabilities * Run prettier * Update api.md Co-authored-by: Austin Chen --- docs/docs/api.md | 2 +- web/pages/api/v0/_types.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/docs/api.md b/docs/docs/api.md index deaf4cd2..d25a18be 100644 --- a/docs/docs/api.md +++ b/docs/docs/api.md @@ -411,7 +411,7 @@ Requires no authorization. type FullMarket = LiteMarket & { bets: Bet[] comments: Comment[] - answers?: Answer[] // Free response markets only + answers?: Answer[] // dpm-2 markets only description: JSONContent // Rich text content. See https://tiptap.dev/guide/output#option-1-json textDescription: string // string description without formatting, images, or embeds } diff --git a/web/pages/api/v0/_types.ts b/web/pages/api/v0/_types.ts index ea2f053b..ccaa217d 100644 --- a/web/pages/api/v0/_types.ts +++ b/web/pages/api/v0/_types.ts @@ -149,7 +149,8 @@ export function toFullMarket( ): FullMarket { const liteMarket = toLiteMarket(contract) const answers = - contract.outcomeType === 'FREE_RESPONSE' + contract.outcomeType === 'FREE_RESPONSE' || + contract.outcomeType === 'MULTIPLE_CHOICE' ? contract.answers.map((answer) => augmentAnswerWithProbability(contract, answer) )