Fix FAQFull: Use isDraft boolean for draft filtering, fix Kontakt ID override
This commit is contained in:
@@ -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()
|
||||
Reference in New Issue
Block a user