Fix FAQFull: Use isDraft boolean for draft filtering, fix Kontakt ID override

This commit is contained in:
MichalC
2026-09-16 12:31:19 +02:00
parent 437e1e4823
commit 9043301da6
140 changed files with 23337 additions and 724 deletions
+31
View File
@@ -0,0 +1,31 @@
import { getPayload } from 'payload'
import configPromise from '../src/payload.config'
async function run() {
const payload = await getPayload({ config: configPromise })
for (const locale of ['pl', 'de'] as const) {
const doc = await payload.findByID({
collection: 'pages',
id: 5,
locale
})
// Filter out faqFull block
const newLayout = doc.layout?.filter((b: any) => b.blockType !== 'faqFull') || []
await payload.update({
collection: 'pages',
id: 5,
locale,
data: {
layout: newLayout
}
})
console.log(`[${locale}] Usunięto faqFull z Kontakt (ID 5)`)
}
process.exit(0)
}
run()