Get answer outcome from comment

This commit is contained in:
Ian Philips 2022-05-17 16:08:55 -06:00
parent d458d8a299
commit 66434fc9d6

View File

@ -47,6 +47,13 @@ export const onCreateComment = functions.firestore
contract.outcomeType === 'FREE_RESPONSE' && contract.answers
? contract.answers.find((answer) => answer.id === bet?.outcome)
: undefined
} else if (comment.answerOutcome) {
answer =
contract.outcomeType === 'FREE_RESPONSE' && contract.answers
? contract.answers?.find(
(answer) => answer.id === comment.answerOutcome
)
: undefined
}
const comments = await getValues<Comment>(