From 935c550733e7e24f54185a76558916a7e0677789 Mon Sep 17 00:00:00 2001 From: James Grugett Date: Mon, 19 Sep 2022 16:26:33 -0500 Subject: [PATCH] Revalidate static props on market resolve --- functions/src/resolve-market.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/functions/src/resolve-market.ts b/functions/src/resolve-market.ts index feddd67c..ca8f5fc0 100644 --- a/functions/src/resolve-market.ts +++ b/functions/src/resolve-market.ts @@ -9,7 +9,7 @@ import { RESOLUTIONS, } from '../../common/contract' import { Bet } from '../../common/bet' -import { getUser, getValues, isProd, log, payUser } from './utils' +import { getContractPath, getUser, getValues, isProd, log, payUser, revalidateStaticProps } from './utils' import { getLoanPayouts, getPayouts, @@ -171,6 +171,8 @@ export const resolvemarket = newEndpoint(opts, async (req, auth) => { await processPayouts([...payouts, ...loanPayouts]) await undoUniqueBettorRewardsIfCancelResolution(contract, outcome) + await revalidateStaticProps(getContractPath(contract)) + const userPayoutsWithoutLoans = groupPayoutsByUser(payouts) const userInvestments = mapValues(