Added wiki pages to revalidate
This commit is contained in:
parent
be1a32181e
commit
18186f2014
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue