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']) { const slug = locale === 'pl' ? 'uslugi' : 'leistungen' const pages = await payload.find({ collection: 'pages', locale: locale as any, where: { slug: { equals: slug } } }) if (pages.docs.length > 0) { const page = pages.docs[0] page.layout?.forEach((b:any) => { if (b.blockType === 'servicesDetailed' && b.services) { b.services.forEach((s:any) => console.log(`${locale.toUpperCase()}: "${s.title}" -> ${s.anchor}`)) } }) } } process.exit(0) } run()