diff --git a/src/pages/api/revalidate.ts b/src/pages/api/revalidate.ts index e8791ec..efcd978 100644 --- a/src/pages/api/revalidate.ts +++ b/src/pages/api/revalidate.ts @@ -8,7 +8,8 @@ type RequestProps = | HookChronology | HookContent | HookContentGroup - | HookCustom; + | HookCustom + | HookWiki; type HookRangedContent = { event: "entry.update" | "entry.delete" | "entry.create"; @@ -76,6 +77,14 @@ type HookChronology = { model: "chronology-era" | "chronology-item"; }; +type HookWiki = { + event: "entry.update" | "entry.delete" | "entry.create"; + model: "wiki-page"; + entry: { + slug: string; + }; +}; + type ResponseMailProps = { message: string; revalidated: boolean; @@ -191,6 +200,17 @@ const Revalidate = async ( break; } + case "wiki-page": { + paths.push(`/wiki`); + paths.push(`/wiki/${body.entry.slug}`); + serverRuntimeConfig.locales?.map((locale: string) => { + paths.push(`/${locale}/wiki`); + paths.push(`/${locale}/wiki/${body.entry.slug}`); + }); + + break; + } + case "custom": { paths.push(`${body.url}`); break;