fix(plugin-nested-docs): update draft and published child docs on resave (#10454)

### What?
Fixes bug with **plugin-nested-docs**. The plugin should update the
breadcrumb data of any child documents when the parent doc is updated,
currently only the **draft** child document is updated.

### How?
Updates the resave function to fetch draft and published child docs.

Closes issue #10066
This commit is contained in:
Jessica Chowdhury
2025-01-27 13:28:15 +00:00
committed by GitHub
parent c1c64a07a2
commit 7a398704a0
2 changed files with 84 additions and 66 deletions

View File

@@ -72,6 +72,7 @@ describe('@payloadcms/plugin-nested-docs', () => {
title: `Child ${i + 1}`,
slug: `child-${i + 1}`,
parent: parentDoc.id,
_status: 'published',
},
})
}
@@ -83,6 +84,7 @@ describe('@payloadcms/plugin-nested-docs', () => {
data: {
title: '11 children updated',
slug: '11-children-updated',
_status: 'published',
},
})
@@ -90,7 +92,6 @@ describe('@payloadcms/plugin-nested-docs', () => {
const { docs } = await payload.find({
collection: 'pages',
limit: 0,
draft: true,
where: {
parent: {
equals: parentDoc.id,