Cast results of removeUndefinedProps when neccessary
This commit is contained in:
parent
f992a9ba04
commit
5541617bc8
|
@ -42,7 +42,7 @@ export function getNewContract(
|
|||
? getNumericProps(ante, bucketCount, min, max)
|
||||
: getFreeAnswerProps(ante)
|
||||
|
||||
const contract: Contract = removeUndefinedProps({
|
||||
return removeUndefinedProps({
|
||||
id,
|
||||
slug,
|
||||
...propsByOutcomeType,
|
||||
|
@ -71,9 +71,7 @@ export function getNewContract(
|
|||
platformFee: 0,
|
||||
},
|
||||
manaLimitPerUser,
|
||||
})
|
||||
|
||||
return contract as Contract
|
||||
}) as Contract
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -46,7 +46,7 @@ export function AnswerResolvePanel(props: {
|
|||
resolutions:
|
||||
resolveOption === 'CHOOSE_MULTIPLE' ? normalizedProbs : undefined,
|
||||
contractId: contract.id,
|
||||
})
|
||||
}) as {outcome: string, contractId: string, resolutions: {[x: string]: number} | undefined}
|
||||
|
||||
const result = await resolveMarket(resolutionProps).then((r) => r.data)
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ export async function createComment(
|
|||
const ref = betId
|
||||
? doc(getCommentsCollection(contractId), betId)
|
||||
: doc(getCommentsCollection(contractId))
|
||||
const comment: Comment = removeUndefinedProps({
|
||||
const comment = removeUndefinedProps({
|
||||
id: ref.id,
|
||||
contractId,
|
||||
userId: commenter.id,
|
||||
|
@ -42,7 +42,7 @@ export async function createComment(
|
|||
betId: betId,
|
||||
answerOutcome: answerOutcome,
|
||||
replyToCommentId: replyToCommentId,
|
||||
})
|
||||
}) as Comment
|
||||
return await setDoc(ref, comment)
|
||||
}
|
||||
|
||||
|
|
|
@ -94,5 +94,5 @@ export function toLiteMarket(contract: Contract): LiteMarket {
|
|||
isResolved,
|
||||
resolution,
|
||||
resolutionTime,
|
||||
})
|
||||
}) as LiteMarket
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user