fix(testimonials): group dots by pages on desktop and scroll by two items

This commit is contained in:
MichalC
2026-09-17 23:22:01 +02:00
parent ab4c5c83dd
commit a82b35d298
3 changed files with 131 additions and 7 deletions
+30
View File
@@ -0,0 +1,30 @@
import { getPayload } from 'payload'
import configPromise from '../src/payload.config'
async function run() {
const payload = await getPayload({ config: configPromise })
const pages = await payload.find({ collection: 'pages', limit: 100 }) // fetch all locales?
const plPages = await payload.find({ collection: 'pages', locale: 'pl', limit: 100 })
const dePages = await payload.find({ collection: 'pages', locale: 'de', limit: 100 })
console.log("=== PL ===")
plPages.docs.forEach(page => {
page.layout?.forEach(block => {
if (block.blockType === 'testimonials' || block.blockType === 'testimonialsGrid') {
console.log(`Page: ${page.slug}, Block: ${block.blockType}, Items: ${block.testimonials?.length || 0}`)
}
})
})
console.log("=== DE ===")
dePages.docs.forEach(page => {
page.layout?.forEach(block => {
if (block.blockType === 'testimonials' || block.blockType === 'testimonialsGrid') {
console.log(`Page: ${page.slug}, Block: ${block.blockType}, Items: ${block.testimonials?.length || 0}`)
}
})
})
process.exit(0)
}
run()