Skip to content

Commit

Permalink
Remove answer duplication logic
Browse files Browse the repository at this point in the history
  • Loading branch information
sipec committed Nov 28, 2024
1 parent 5e3bd62 commit bb01407
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions backend/api/src/create-answer-cpmm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,7 @@ const createAnswerCpmmFull = async (
) => {
log('Received ' + contractId + ' ' + text)
const contract = await verifyContract(contractId, userId)
const response = await createAnswerCpmmMain(contract, text, userId)

// copy answer if this is sweeps question
if (contract.siblingContractId) {
const cashContract = await getContractSupabase(contract.siblingContractId)
if (!cashContract) throw new APIError(500, 'Cash contract not found')
await createAnswerCpmmMain(cashContract as any, text, userId)
// ignore continuation of sweepstakes answer, since don't need to notify twice
}

return response
return await createAnswerCpmmMain(contract, text, userId)
}

const verifyContract = async (contractId: string, creatorId: string) => {
Expand Down

0 comments on commit bb01407

Please sign in to comment.