Take descriptions out of LiteMarket (#789)
This commit is contained in:
parent
baa27a3c85
commit
b476a7e3f8
|
@ -97,7 +97,6 @@ Requires no authorization.
|
||||||
"creatorAvatarUrl":"https://lh3.googleusercontent.com/a-/AOh14GiZyl1lBehuBMGyJYJhZd-N-mstaUtgE4xdI22lLw=s96-c",
|
"creatorAvatarUrl":"https://lh3.googleusercontent.com/a-/AOh14GiZyl1lBehuBMGyJYJhZd-N-mstaUtgE4xdI22lLw=s96-c",
|
||||||
"closeTime":1653893940000,
|
"closeTime":1653893940000,
|
||||||
"question":"Will I write a new blog post today?",
|
"question":"Will I write a new blog post today?",
|
||||||
"description":"I'm supposed to, or else Beeminder charges me $90.\nTentative topic ideas:\n- \"Manifold funding, a history\"\n- \"Markets and bounties allow trades through time\"\n- \"equity vs money vs time\"\n\nClose date updated to 2022-05-29 11:59 pm",
|
|
||||||
"tags":[
|
"tags":[
|
||||||
"personal",
|
"personal",
|
||||||
"commitments"
|
"commitments"
|
||||||
|
@ -135,8 +134,6 @@ Requires no authorization.
|
||||||
// Market attributes. All times are in milliseconds since epoch
|
// Market attributes. All times are in milliseconds since epoch
|
||||||
closeTime?: number // Min of creator's chosen date, and resolutionTime
|
closeTime?: number // Min of creator's chosen date, and resolutionTime
|
||||||
question: string
|
question: string
|
||||||
description: JSONContent // Rich text content. See https://tiptap.dev/guide/output#option-1-json
|
|
||||||
textDescription: string // string description without formatting, images, or embeds
|
|
||||||
|
|
||||||
// A list of tags on each market. Any user can add tags to any market.
|
// A list of tags on each market. Any user can add tags to any market.
|
||||||
// This list also includes the predefined categories shown as filters on the home page.
|
// This list also includes the predefined categories shown as filters on the home page.
|
||||||
|
@ -398,6 +395,8 @@ Requires no authorization.
|
||||||
bets: Bet[]
|
bets: Bet[]
|
||||||
comments: Comment[]
|
comments: Comment[]
|
||||||
answers?: Answer[]
|
answers?: Answer[]
|
||||||
|
description: JSONContent // Rich text content. See https://tiptap.dev/guide/output#option-1-json
|
||||||
|
textDescription: string // string description without formatting, images, or embeds
|
||||||
}
|
}
|
||||||
|
|
||||||
type Bet = {
|
type Bet = {
|
||||||
|
|
|
@ -22,8 +22,6 @@ export type LiteMarket = {
|
||||||
// Market attributes. All times are in milliseconds since epoch
|
// Market attributes. All times are in milliseconds since epoch
|
||||||
closeTime?: number
|
closeTime?: number
|
||||||
question: string
|
question: string
|
||||||
description: string | JSONContent
|
|
||||||
textDescription: string // string version of description
|
|
||||||
tags: string[]
|
tags: string[]
|
||||||
url: string
|
url: string
|
||||||
outcomeType: string
|
outcomeType: string
|
||||||
|
@ -54,6 +52,8 @@ export type FullMarket = LiteMarket & {
|
||||||
bets: Bet[]
|
bets: Bet[]
|
||||||
comments: Comment[]
|
comments: Comment[]
|
||||||
answers?: ApiAnswer[]
|
answers?: ApiAnswer[]
|
||||||
|
description: string | JSONContent
|
||||||
|
textDescription: string // string version of description
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ApiError = {
|
export type ApiError = {
|
||||||
|
@ -81,7 +81,6 @@ export function toLiteMarket(contract: Contract): LiteMarket {
|
||||||
creatorAvatarUrl,
|
creatorAvatarUrl,
|
||||||
closeTime,
|
closeTime,
|
||||||
question,
|
question,
|
||||||
description,
|
|
||||||
tags,
|
tags,
|
||||||
slug,
|
slug,
|
||||||
pool,
|
pool,
|
||||||
|
@ -118,11 +117,6 @@ export function toLiteMarket(contract: Contract): LiteMarket {
|
||||||
? Math.min(resolutionTime, closeTime)
|
? Math.min(resolutionTime, closeTime)
|
||||||
: closeTime,
|
: closeTime,
|
||||||
question,
|
question,
|
||||||
description,
|
|
||||||
textDescription:
|
|
||||||
typeof description === 'string'
|
|
||||||
? description
|
|
||||||
: richTextToString(description),
|
|
||||||
tags,
|
tags,
|
||||||
url: `https://manifold.markets/${creatorUsername}/${slug}`,
|
url: `https://manifold.markets/${creatorUsername}/${slug}`,
|
||||||
pool,
|
pool,
|
||||||
|
@ -158,11 +152,18 @@ export function toFullMarket(
|
||||||
)
|
)
|
||||||
: undefined
|
: undefined
|
||||||
|
|
||||||
|
const { description } = contract
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...liteMarket,
|
...liteMarket,
|
||||||
answers,
|
answers,
|
||||||
comments,
|
comments,
|
||||||
bets,
|
bets,
|
||||||
|
description,
|
||||||
|
textDescription:
|
||||||
|
typeof description === 'string'
|
||||||
|
? description
|
||||||
|
: richTextToString(description),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user