From 20f3fa9eecd32f152c3ad3ab897a69616f5bf14a Mon Sep 17 00:00:00 2001 From: Sinclair Chen Date: Fri, 29 Jul 2022 15:33:45 -0700 Subject: [PATCH] Add min, max, isLogScale to numeric market API return --- web/.eslintrc.js | 1 + web/pages/api/v0/_types.ts | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/web/.eslintrc.js b/web/.eslintrc.js index fec650f9..0f103080 100644 --- a/web/.eslintrc.js +++ b/web/.eslintrc.js @@ -5,6 +5,7 @@ module.exports = { 'plugin:@typescript-eslint/recommended', 'plugin:react-hooks/recommended', 'plugin:@next/next/recommended', + 'prettier', ], rules: { '@typescript-eslint/no-empty-function': 'off', diff --git a/web/pages/api/v0/_types.ts b/web/pages/api/v0/_types.ts index 5b9a7dab..7474bbcd 100644 --- a/web/pages/api/v0/_types.ts +++ b/web/pages/api/v0/_types.ts @@ -97,6 +97,11 @@ export function toLiteMarket(contract: Contract): LiteMarket { const probability = contract.outcomeType === 'BINARY' ? getProbability(contract) : undefined + let min, max, isLogScale: any + if (contract.outcomeType === 'PSEUDO_NUMERIC') { + ;({ min, max, isLogScale } = contract) + } + return removeUndefinedProps({ id, creatorUsername, @@ -124,6 +129,9 @@ export function toLiteMarket(contract: Contract): LiteMarket { resolution, resolutionTime, resolutionProbability, + min, + max, + isLogScale, }) }