Library items updates also update the parent items

This commit is contained in:
DrMint 2022-04-09 13:47:44 +02:00
parent c98537c85e
commit 31d68dc6ae
1 changed files with 9 additions and 1 deletions

View File

@ -47,6 +47,11 @@ type HookLibraryItem = {
model: "library-item"; model: "library-item";
entry: { entry: {
slug: string; slug: string;
subitem_of: [
{
slug: string;
}
];
}; };
}; };
@ -94,6 +99,9 @@ export default async function Mail(
paths.push(`/library/${body.entry.slug}`); paths.push(`/library/${body.entry.slug}`);
serverRuntimeConfig.locales?.map((locale: string) => { serverRuntimeConfig.locales?.map((locale: string) => {
paths.push(`/${locale}/library/${body.entry.slug}`); paths.push(`/${locale}/library/${body.entry.slug}`);
body.entry.subitem_of.map((parentItem) => {
paths.push(`/${locale}/library/${parentItem.slug}`);
});
paths.push(`/${locale}/library`); paths.push(`/${locale}/library`);
}); });
break; break;
@ -147,7 +155,7 @@ export default async function Mail(
break; break;
} }
console.table(paths); //console.table(paths);
try { try {
Promise.all( Promise.all(