From fa48a192e35b1127ccc0207c2effbd0afc83da11 Mon Sep 17 00:00:00 2001 From: tobias Date: Sun, 23 Jun 2024 23:12:32 +0200 Subject: [PATCH] Enable richtext block --- src/app/(payload)/collections/Pages.ts | 4 ++-- src/components/Blocks/index.tsx | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/app/(payload)/collections/Pages.ts b/src/app/(payload)/collections/Pages.ts index ade491d..2c84f12 100644 --- a/src/app/(payload)/collections/Pages.ts +++ b/src/app/(payload)/collections/Pages.ts @@ -25,13 +25,13 @@ const Pages: CollectionConfig = { update: isAdmin, delete: isAdmin, }, - /* hooks: { + hooks: { afterChange: [ async ({ doc, collection }) => { revalidateTag(generateDocumentCacheKey(collection.slug, doc.path)) }, ], - }, */ + }, fields: [ { type: 'tabs', diff --git a/src/components/Blocks/index.tsx b/src/components/Blocks/index.tsx index bb94bd2..440806d 100644 --- a/src/components/Blocks/index.tsx +++ b/src/components/Blocks/index.tsx @@ -1,4 +1,6 @@ +import Paragraph from '@/app/(payload)/blocks/paragraph' import Author from './Author' +import RichText from './RichText' export type AdditionalBlockProps = { blockIndex: number @@ -7,6 +9,8 @@ export type AdditionalBlockProps = { const blockComponents = { Author: Author, + RichText: RichText, + Paragraph: Paragraph, } const Blocks = ({ blocks, locale }: any) => {