13 lines
341 B
TypeScript
13 lines
341 B
TypeScript
import type { GlobalAfterChangeHook } from 'payload'
|
|
|
|
import { revalidateTag } from 'next/cache'
|
|
|
|
export const revalidateFooter: GlobalAfterChangeHook = ({ doc, req: { payload, context } }) => {
|
|
if (!context.disableRevalidate) {
|
|
payload.logger.info(`Revalidating footer`)
|
|
|
|
revalidateTag('global_footer', 'max')
|
|
}
|
|
|
|
return doc
|
|
}
|