Revalidate static props for new comments
This commit is contained in:
parent
1a82ce193d
commit
de8e4df04c
|
@ -1,7 +1,13 @@
|
|||
import * as functions from 'firebase-functions'
|
||||
import * as admin from 'firebase-admin'
|
||||
import { compact } from 'lodash'
|
||||
import { getContract, getUser, getValues } from './utils'
|
||||
import {
|
||||
getContract,
|
||||
getContractPath,
|
||||
getUser,
|
||||
getValues,
|
||||
revalidateStaticProps,
|
||||
} from './utils'
|
||||
import { ContractComment } from '../../common/comment'
|
||||
import { Bet } from '../../common/bet'
|
||||
import { Answer } from '../../common/answer'
|
||||
|
@ -34,6 +40,8 @@ export const onCreateCommentOnContract = functions
|
|||
contractQuestion: contract.question,
|
||||
})
|
||||
|
||||
await revalidateStaticProps(getContractPath(contract))
|
||||
|
||||
const comment = change.data() as ContractComment
|
||||
const lastCommentTime = comment.createdTime
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user