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