fix(plugin-nested-docs): corrects data shape of breadcrumbs returned in hooks (#10866)
### What? The `plugin-nested-docs` returns an array of breadcrumbs - the `resaveChildren` file accidentally processed the breadcrumbs twice, once where the data is updated and once within the `populateBreadcrumbs` function which was causing the objects to be double nested. ### How? Removes the extra nesting from `resaveChildren` file and allows the `populateBreadcrumbs` to return the final data. Fixes #10855
This commit is contained in:
committed by
GitHub
parent
d32608649c
commit
d92c0009ed
@@ -81,10 +81,7 @@ const resave = async ({ collection, doc, draft, pluginConfig, req }: ResaveArgs)
|
||||
await req.payload.update({
|
||||
id: child.id,
|
||||
collection: collection.slug,
|
||||
data: {
|
||||
...child,
|
||||
[breadcrumbSlug]: await populateBreadcrumbs(req, pluginConfig, collection, child),
|
||||
},
|
||||
data: populateBreadcrumbs(req, pluginConfig, collection, child),
|
||||
depth: 0,
|
||||
draft: isDraft,
|
||||
locale: req.locale,
|
||||
|
||||
Reference in New Issue
Block a user